core (log): fixed double call to ansiColors
This commit is contained in:
parent
97d655682c
commit
93a73aec45
1 changed files with 3 additions and 7 deletions
|
|
@ -56,9 +56,8 @@ class ConfigureBasic(log.ConfigureBase):
|
||||||
isatty = sys.stdout.isatty()
|
isatty = sys.stdout.isatty()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
isatty = False
|
isatty = False
|
||||||
if (
|
# FIXME: isatty should be tested on each handler, not globaly
|
||||||
force_colors or isatty
|
if (force_colors or isatty):
|
||||||
): # FIXME: isatty should be tested on each handler, not globaly
|
|
||||||
# we need colors
|
# we need colors
|
||||||
log.Logger.post_treat = lambda logger, level, message: self.ansiColors(
|
log.Logger.post_treat = lambda logger, level, message: self.ansiColors(
|
||||||
level, message
|
level, message
|
||||||
|
|
@ -123,11 +122,8 @@ class ConfigureTwisted(ConfigureBasic):
|
||||||
can_colors and self.LOGGER_CLASS.colors
|
can_colors and self.LOGGER_CLASS.colors
|
||||||
) or self.LOGGER_CLASS.force_colors:
|
) or self.LOGGER_CLASS.force_colors:
|
||||||
message = event.get("message", tuple())
|
message = event.get("message", tuple())
|
||||||
level = event.get("level", C.LOG_LVL_INFO)
|
|
||||||
if message:
|
if message:
|
||||||
event["message"] = (
|
event["message"] = ("".join(message),) # must be a tuple
|
||||||
self.ansiColors(level, "".join(message)),
|
|
||||||
) # must be a tuple
|
|
||||||
observer(event) # we can now call the original observer
|
observer(event) # we can now call the original observer
|
||||||
|
|
||||||
return observer_hook
|
return observer_hook
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue