mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 21:40:19 -06:00
Python 3 compatibility.
This commit is contained in:
@@ -14,12 +14,13 @@ LOG_LEVEL_COLORS = {
|
||||
|
||||
|
||||
class LoggingHandler(logging.Handler):
|
||||
def __init__(self, use_color):
|
||||
def __init__(self, use_color, print_fn=print):
|
||||
logging.Handler.__init__(self)
|
||||
self.use_color = use_color
|
||||
self.__print_fn = print_fn
|
||||
|
||||
def emit(self, record):
|
||||
print(
|
||||
self.__print_fn(
|
||||
u'{0}{1}'.format(
|
||||
color.format_color(
|
||||
'[{0}]'.format(record.levelname),
|
||||
|
||||
Reference in New Issue
Block a user