utils.logmixin — Colorized logging

class ievv_opensource.utils.logmixin.Logger(name, level=None)[source]

Bases: object

Logger class used by LogMixin.

Parameters:name – The name of the logger.
classmethod get_instance(name, level=None, command_error_message=None)[source]

Get an instance of the logger by the given name.

Parameters:name – The name of the logger.
stdout(line)[source]

Use this to redirecting sys.stdout when running shell commands.

stderr(line)[source]

Use this to redirecting sys.stderr when running shell commands.

info(message)[source]

Log an info message.

success(message)[source]

Log a success message.

warning(message)[source]

Log a warning message.

error(message)[source]

Log a warning message.

debug(message)[source]

Log a debug message.

command_start(message)[source]

Log the start of a command. This should be used in the beginning of each ievv_opensource.utils.ievvbuildstatic.pluginbase.Plugin.run().

command_error(message)[source]

Log failing end of a command. This should be used in ievv_opensource.utils.ievvbuildstatic.pluginbase.Plugin.run() when the task fails.

command_success(message)[source]

Log successful end of a command. This should be used in ievv_opensource.utils.ievvbuildstatic.pluginbase.Plugin.run() when the task succeeds.

class ievv_opensource.utils.logmixin.LogMixin[source]

Bases: object

Mixin class that takes care of logging for all the classes in the ievvbuildstatic package.

Subclasses must override get_logger_name(), and use get_logger().

get_logger_name()[source]

Get the name of the logger.

get_logger()[source]

Get an instance of Logger() with get_logger_name() as the logger name.