Beispiel #1
0
    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 ''
Beispiel #2
0
    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 ''
Beispiel #3
0
def warn(msg):
    # type: (str) -> None
    print (colors.yellow(msg))
Beispiel #4
0
 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'))
Beispiel #5
0
 def test_format_warn(self):
     output = self.formatter.format(make_log_record(logging.WARN))
     expected = colors.yellow('WARNING') + ': '
     assert output == expected + MESSAGE
Beispiel #6
0
 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'))
Beispiel #7
0
 def test_format_warn(self):
     output = self.formatter.format(make_log_record(logging.WARN))
     expected = colors.yellow('WARNING') + ': '
     assert output == expected + MESSAGE
Beispiel #8
0
def warn(msg):
    print(colors.yellow(msg))