friendlyshell.basic_logger_mixin module

Mixin for displaying output from a friendly shell

class friendlyshell.basic_logger_mixin.BasicLoggerMixin(*args, **kwargs)[source]

Bases: object

Mixin class, to be combined with a Friendly Shell, to direct log output to a default output stream

The assumption here is that all Friendly Shell derived classes are going to use the print(), warning() and error() methods on this class to interact with the shell, and those methods in turn will use the Python logging API to delegate output to. By default those methods should direct their output to stdout, however if a user has s need to redriect the output elsewhere - like, when running a shell in a non-interactive or headless environment - then they can easily do so by simply re-configuring the default logger for the library

Helpful links relating to logging

https://docs.python.org/2/library/logging.html#logrecord-attributes https://docs.python.org/2/library/logging.html#logging-levels

debug(message, *args, **kwargs)[source]

Displays an internal-use-only debug message to verbose log file

Parameters:message (str) – text to be displayed
error(message, *args, **kwargs)[source]

Displays a critical error message to the default output stream

Parameters:message (str) – text to be displayed
info(message, *args, **kwargs)[source]

Displays an info message to the default output stream

Parameters:message (str) – text to be displayed
warning(message, *args, **kwargs)[source]

Displays a non-critical warning message to the default output stream

Parameters:message (str) – text to be displayed