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