-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to force colours #611
Comments
As you probably noticed above that was the
When we get this error we failback to writing a log without colours on Windows OS https://github.com/odygrd/quill/blob/add-colourmode/include/quill/sinks/ConsoleSink.h#L458 |
For windows it won’t work even if you force them Colours are not working when running the application in QtCreator Application Output or VS debug window. This is because these environments don't provide a standard Windows console handle and Quill is using the console handle to set the colours for Windows For Linux ANSI codes are used but I haven’t tested QtCreator on Linux To handle outputting colours in non console environments on Windows we need to use ANSI codes which is currently only enabled for Linux Are you using Windows or a different OS to run QtCreator ? |
In version quill::Frontend::create_or_get_sink<quill::ConsoleSink>(
"sink_id_1", quill::ConsoleColours::ColourMode::Always); A further fix in version 8.0.0 (expected in a few months/weeks), will fix this on Windows as well. |
Thank you for confirming it works ! |
Is your feature request related to a problem? Please describe.
Colours are missing in Quill logs when running an application in QtCreator. QtCreator doesn't run the application in a terminal, but the output is shown in Application Output. I don't really know what kind of environment Application Output is, but it seems like Quill doesn't detect that it can show colour there. (Colours should be available in Application Output).
Describe the solution you'd like
An option to force colour usage to override the
ConsoleColours::_set_can_use_colours()
logic.Additional context
A similar problem and solution with SpdLog: https://stackoverflow.com/questions/78707422/qtcreator-application-output-not-colored-with-logs-from-spdlog-c
The text was updated successfully, but these errors were encountered: