def get_level_message(self, record): separator = ': ' if record.levelno == logging.WARNING: return colors.yellow(record.levelname) + separator if record.levelno == logging.ERROR: return colors.red(record.levelname) + separator return ''
def warn(msg): # type: (str) -> None print (colors.yellow(msg))
def test_format_unicode_warn(self): message = b'\xec\xa0\x95\xec\x88\x98\xec\xa0\x95' output = self.formatter.format(make_log_record(logging.WARN, message)) expected = colors.yellow('WARNING') + ': ' assert output == '{0}{1}'.format(expected, message.decode('utf-8'))
def test_format_warn(self): output = self.formatter.format(make_log_record(logging.WARN)) expected = colors.yellow('WARNING') + ': ' assert output == expected + MESSAGE
def warn(msg): print(colors.yellow(msg))