Printer

class imagepypelines.Printer(name, log_level=0)[source]

Bases: object

Object used to print out messages to the terminal for a given process or object. This is meant to increase traceability particularly for people who are developing imagepypelines

Each message printed out using this object is automatically colorized, filtered for the current log level, and prefixed

Attributes Summary

ACTIVE_PRINTERS
BLACKLIST
ENABLE_COLOR
GLOBAL_LOG_LEVEL
LOG_LEVELS
MIN_NAME_SIZE
WHITELIST

Methods Summary

comment(*messages) prints out objects at comment level for this printer
critical(*messages) prints out objects at critical level for this printer
debug(*messages) prints out objects at debug level for this printer
error(*messages) prints out objects at error level for this printer
info(*messages) prints out objects at info level for this printer
set_log_level(log_level) sets the local log_level for this printer
should_print(message_level) Determines whether or not the given message level should print to the terminal
warning(*messages) prints out objects at warning level for this printer

Attributes Documentation

ACTIVE_PRINTERS = {'TIMER': <imagepypelines.core.Printer.Printer object>}
BLACKLIST = []
ENABLE_COLOR = True
GLOBAL_LOG_LEVEL = 20
LOG_LEVELS = {'comment': 60, 'critical': 50, 'debug': 10, 'error': 40, 'info': 20, 'warning': 30}
MIN_NAME_SIZE = 18
WHITELIST = 'all'

Methods Documentation

comment(*messages)[source]

prints out objects at comment level for this printer

Parameters:*messages – objects or messages to print out at comment level
Returns:None
critical(*messages)[source]

prints out objects at critical level for this printer

Parameters:*messages – objects or messages to print out at critical level
Returns:None
debug(*messages)[source]

prints out objects at debug level for this printer

Parameters:*messages – objects or messages to print out at debug level
Returns:None
error(*messages)[source]

prints out objects at error level for this printer

Parameters:*messages – objects or messages to print out at error level
Returns:None
info(*messages)[source]

prints out objects at info level for this printer

Parameters:*messages – objects or messages to print out at info level
Returns:None
set_log_level(log_level)[source]

sets the local log_level for this printer

should_print(message_level)[source]

Determines whether or not the given message level should print to the terminal

Parameters:message_level (str,int) – level of the message
Returns:Whether or not the printer should print at that level
Return type:bool
warning(*messages)[source]

prints out objects at warning level for this printer

Parameters:*messages – objects or messages to print out at warning level
Returns:None