2

I've installed coloredlogs with

pip install coloredlogs

and now for testing it out I'm running

coloredlogs --demo

I get no colors on the output and an exception

[32m2017-05-03 14:09:37[0m [35mDESKTOP-TV3I2CC[0m 
[34mcoloredlogs.demo[28720][0m [30mINFO[0m message with level 'info'
[32m2017-05-03 14:09:38[0m [35mDESKTOP-TV3I2CC[0m [34mcoloredlogs.demo[28720][0m [30mWARNING[0m [33mmessage with level 'warn'[0m
[32m2017-05-03 14:09:39[0m [35mDESKTOP-TV3I2CC[0m [34mcoloredlogs.demo[28720][0m [30mERROR[0m [31mmessage with level 'error'[0m
[32m2017-05-03 14:09:40[0m [35mDESKTOP-TV3I2CC[0m [34mcoloredlogs.demo[28720][0m [30mCRITICAL[0m [31mmessage with level 'critical'[0m
[32m2017-05-03 14:09:41[0m [35mDESKTOP-TV3I2CC[0m [34mcoloredlogs.demo[28720][0m [30mERROR[0m [31mSomething went horribly wrong![0m
Traceback (most recent call last):
  File "c:\users\nimat\scoop\apps\python\3.6.0\lib\site-packages\coloredlogs\demo.py", line 43, in demonstrate_colored_logging
    raise RandomException("Something went horribly wrong!")
coloredlogs.demo.demonstrate_colored_logging.<locals>.RandomException: Something went horribly wrong!
[32m2017-05-03 14:09:42[0m [35mDESKTOP-TV3I2CC[0m [34mcoloredlogs.demo[28720][0m [30mINFO[0m Done, exiting ..

Windows is supported according to its documentations. What am I missing?

nimatra
  • 604
  • 8
  • 19
  • It looks like the Esc `0x1e` sequence in front of the square opening bracket is missing. I don't know where this happens maybe just while copy/pasting to SO. Just did a test with coloredlogs - Esc is present but isn't interpreted properly. [This qquestion](http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output) might highlight the issue. Win 10 supporting Ansi Escape sequences is relative new. –  May 03 '17 at 18:53

0 Answers0