loguru icon indicating copy to clipboard operation
loguru copied to clipboard

XCode terminal doesn't interpret colorcoding

Open ruurdadema opened this issue 6 years ago • 2 comments

For some reason my XCode doesn't interpret the color codes correctly. Because of this the log lines become cluttered with garbage.

It looks like this: [0m [2m2019-03-24 19:33:34.915 ( 0.002s) [main thread ] cli.cpp:27 INFO| [0mThis is a test [0m

Copy + pasting a line from XCode terminal looks like this: [0m[2m2019-03-24 19:33:34.915 ( 0.002s) [main thread ] cli.cpp:27 INFO| [0mThis is a test[0m

The OS X Terminal app and iTerm do interpret the color code well.

Any idea of what might be going on?

ruurdadema avatar Mar 24 '19 18:03 ruurdadema

I get this too. If I remember correctly XCode identifies as a terminal which supports colors – but it doesn't.

The workaround it to set loguru::g_colorlogtostderr = false; when running in XCode. I'd be happy if someone could find a better solution.

emilk avatar Mar 27 '19 07:03 emilk

Are you aware of a way of finding out programmatically if the code runs from xcode? If so I then could differentiate between xcode and other terminals.

ruurdadema avatar Apr 17 '19 11:04 ruurdadema