Customize logging to add a VERBOSE level and provide a logger for which the trailing newline can be suppressed.
Do basic configuration for the logging system. Similar to logging.basicConfig but the logger name is configurable and both a file output and a stream output can be created.
Returns a logger object. For this logger the trailing newline in invidual handlers can be suppressed by setting the suppress_newline attribute to True for that handler. More normally use the newlines_suppressed context manager.
The default behaviour is to create a StreamHandler which writes to sys.stdout, set a formatter using the “%(message)s” format string, and add the handler to the “pyyaks” logger.
A number of optional keyword arguments may be specified, which can alter the default behaviour.
| Parameters: |
|
|---|
Context manager to suppress newline output for each handler in the supplied logger. Example:
with newlines_suppressed(logger):
logger.info('Starting something ... ')
# process ...
logger.info('done')
| Parameters: | logger – logger object created with get_logger() |
|---|