We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b67ca49 commit bd771ffCopy full SHA for bd771ff
1 file changed
py/strato/common/log/configurelogging.py
@@ -109,8 +109,12 @@ def _useColorsForScreenOutput():
109
110
111
def _configureOutputToScreen(logger, loggerName):
112
- if logger.handlers == []:
+ streamHandlers = [handler for handler in logger.handlers if isinstance(handler, logging.StreamHandler)]
113
+ if streamHandlers:
114
+ streamHandler = streamHandlers[0]
115
+ else:
116
streamHandler = logging.StreamHandler()
117
+ if streamHandler:
118
if _useColorsForScreenOutput():
119
streamHandler.setFormatter(coloringformatter.ColoringFormatter(
120
'%(created).03f(%(process)d%(threadName)s):%(startColor)s%(levelname)s'
0 commit comments