daiquiri
daiquiri copied to clipboard
ANSI escape character sequences are printed in Windows cmd.exe when outputting to stderr
I'm stuck using Windows :(for work).
The ANSI escape character sequences are printed in Windows cmd.exe when outputting to stderr.
#test.py
import daiquiri
daiquiri.setup()
logger = daiquiri.getLogger()
logger.error("something went wrong")
I can workaround using colorama (the library that IPython uses).
#test_colour.py
import colorama
colorama.init()
import daiquiri
daiquiri.setup()
logger = daiquiri.getLogger()
logger.error("something went wrong")
Colours also work when script is run using ipython as colorama is being used automatically (i.e. ipython test.py
).
Is there a way to tell daiquiri not to output colour escape chars?
Even better ; ), would you consider using colorama as an optional extra?
Oh we should definitely switch to colorama. @blakev maybe you should take a look into that for https://github.com/jd/daiquiri/pull/9 ?
For sure, if you're not against adding the dependency.
No, all good for me. Worst thing we could make it optional, but well. It's a common use case.
Once colorama is used, you can document that Windows is supported in setup.cfg
.