mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Python 3 compatibility.
This commit is contained in:
parent
ddebb83a40
commit
bb365a6e68
10 changed files with 30 additions and 27 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue