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
|