parameters: (self, msg, level_name)
return_statement: return color + msg + ColorFormatter.colors['default']
docstring: Colorize according to log level.
docstring_summary: Colorize according to log level.
docstring_tokens: Colorize according to log level .
function: def _to_color(self, msg, level_name):
          """ Colorize according to log level.
          """
          if level_name == 'TRACE':
              color = ColorFormatter.colors['trace']
          elif level_name == 'DEBUG':
              color = ColorFormatter.colors['debug']
          elif  level_name in 'INFO':
              color = ColorFormatter.colors['info']
          elif level_name == 'WARNING':
              color = ColorFormatter.colors['warning']
          elif level_name == 'ERROR':
              color = ColorFormatter.colors['error']
          elif level_name == 'CRITICAL':
              color = ColorFormatter.colors['critical']
          else:
              color = ColorFormatter.colors['default']
  
          return color + msg + ColorFormatter.colors['default']
function_tokens: def _to_color ( self , msg , level_name ) : if level_name == 'TRACE' : color = ColorFormatter . colors [ 'trace' ] elif level_name == 'DEBUG' : color = ColorFormatter . colors [ 'debug' ] elif level_name in 'INFO' : color = ColorFormatter . colors [ 'info' ] elif level_name == 'WARNING' : color = ColorFormatter . colors [ 'warning' ] elif level_name == 'ERROR' : color = ColorFormatter . colors [ 'error' ] elif level_name == 'CRITICAL' : color = ColorFormatter . colors [ 'critical' ] else : color = ColorFormatter . colors [ 'default' ] return color + msg + ColorFormatter . colors [ 'default' ]