Skip to content

Commit 3c818bc

Browse files
committed
Update reset style in color logging
1 parent 2af42da commit 3c818bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

alphaconf/logging_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
logging.WARNING: colorama.Fore.YELLOW,
2222
logging.INFO: colorama.Fore.GREEN,
2323
# logging.DEBUG: colorama.Fore.LIGHTBLACK_EX,
24+
-1: colorama.Style.RESET_ALL, # reset
2425
}
2526

2627
"""Fields of a default log record"""
@@ -43,7 +44,7 @@ class ColorFormatter(Formatter):
4344
def formatMessage(self, record): # noqa: N802
4445
# we can change the message because each call to format() resets it
4546
if record.levelno in LOG_COLORS:
46-
record.message = LOG_COLORS[record.levelno] + record.message + colorama.Style.RESET_ALL
47+
record.message = LOG_COLORS[record.levelno] + record.message + LOG_COLORS[-1]
4748
return super().formatMessage(record)
4849

4950

0 commit comments

Comments
 (0)