Package brisa :: Package core :: Module log
[hide private]
[frames] | no frames]

Module log

source code

Log module with colored logging feature. Common usage of this module can be only importing it and calling one of the available functions: debug, warning, info, critical, error.

Classes [hide private]
  ColoredFormatter
ColoredFormatter class, which wrappers logging.Formatter.
  ColoredLogger
Functions [hide private]
str
formatter_message(message, use_color=True)
Method to format the pattern in which the log messages will be displayed.
source code
 
setup_logging()
Method to setup the logging options.
source code
Variables [hide private]
  RESET_SEQ = '\033[0m'
  COLOR_SEQ = '\033[1;%dm'
  BOLD_SEQ = '\033[1m'
  COLORS = {'WARNING': YELLOW, 'INFO': WHITE, 'DEBUG': BLUE, 'CR...
  log_dict = {'WARNING': logging.WARNING, 'DEBUG': logging.DEBUG...
  root_logger = getLogger()
  debug = root_logger.debug
  info = root_logger.info
  warning = root_logger.warning
  critical = root_logger.critical
  error = root_logger.error
Function Details [hide private]

formatter_message(message, use_color=True)

source code 

Method to format the pattern in which the log messages will be displayed.

Parameters:
  • message (str) - message log to be displayed
  • use_color (boolean) - Flag to indicates the use of colors or not
Returns: str
the new formatted message

Variables Details [hide private]

COLORS

Value:
{'WARNING': YELLOW, 'INFO': WHITE, 'DEBUG': BLUE, 'CRITICAL': YELLOW, \
'ERROR': RED}

log_dict

Value:
{'WARNING': logging.WARNING, 'DEBUG': logging.DEBUG, 'INFO': logging.I\
NFO, 'CRITICAL': logging.CRITICAL, 'ERROR': logging.ERROR}