Package ivs :: Package aux :: Module loggers
[hide private]
[frames] | no frames]

Module loggers

source code

Set up and configure basic logging facilities.

Typcical use: import the module, and call

>>> logger = get_basic_logger()

in your script. All relevant messages will get logged to the terminal.

Classes [hide private]
  NullHandler
The NullHandler is part of the standard logging module only from Python 2.7 on.
Functions [hide private]
 
get_basic_logger(name="", clevel='INFO', flevel='DEBUG', filename=None, filemode='w')
Return a basic logger via a log file and/or terminal.
source code
Function Details [hide private]

get_basic_logger(name="", clevel='INFO', flevel='DEBUG', filename=None, filemode='w')

source code 

Return a basic logger via a log file and/or terminal.

Example 1: log only to the console, accepting levels "INFO" and above

>>> logger = loggers.get_basic_logger()

Example 2: log only to the console, accepting levels "DEBUG" and above

>>> logger = loggers.get_basic_logger(clevel='DEBUG')

Example 3: log only to a file, accepting levels "DEBUG" and above

>>> logger = loggers.get_basic_logger(clevel=None,filename='mylog.log')

Example 4: log only to a file, accepting levels "INFO" and above

>>> logger = loggers.get_basic_logger(clevel=None,flevel='INFO',filename='mylog.log')

Example 5: log to the terminal (INFO and above) and file (DEBUG and above)

>>> logger = loggers.get_basic_logger(filename='mylog.log')
Parameters:
  • name (str) - name of the logger