You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the docs, it says if chromalog detects non-color supporting terminal, it will fall back on monochrome. but i have a custom terminal (written in java) where i would like to launch a python process (using chromalog) and have it continue to output ansi color codes, even though chromalog thinks the python process is running in non-ansi environment.
so, is there a way to turn off this auto-detecting ansi terminal behavior, so that it always logs with ansi codes?
(looking thru the code i see that in stream.py, function stream_has_color_support checks for color support:
getattr(stream, 'isatty', lambda: False)()
is there a simple way to initialize logging with a stream where the 'isatty' is set to True?)
The text was updated successfully, but these errors were encountered:
# proxy class to fool chromalog into thinking we are *always* isatty:
class PseudoTTY(object):
def __init__(self, underlying):
self.__underlying = underlying
def __getattr__(self, name):
return getattr(self.__underlying, name)
def isatty(self):
return True
# wrap PseudoTTY proxy around sys.stderr and use like so:
chromalog.basicConfig(format=logformat, level=logging.INFO, stream=PseudoTTY(sys.stderr))
in the docs, it says if chromalog detects non-color supporting terminal, it will fall back on monochrome. but i have a custom terminal (written in java) where i would like to launch a python process (using chromalog) and have it continue to output ansi color codes, even though chromalog thinks the python process is running in non-ansi environment.
so, is there a way to turn off this auto-detecting ansi terminal behavior, so that it always logs with ansi codes?
(looking thru the code i see that in stream.py, function stream_has_color_support checks for color support:
getattr(stream, 'isatty', lambda: False)()
is there a simple way to initialize logging with a stream where the 'isatty' is set to True?)
The text was updated successfully, but these errors were encountered: