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
Yes, that's possible and would be a nice extension. But the logger must detect whether the output is a terminal (e.g. using isatty) and whether it supports colors (e.g. using terminfo), and generate separate log lines for the console and output to a file.
I personally would only colorize the severity prefixes, like [ ERROR ] or [ Warning], but not the whole log line. Might be a matter of taste. And the stream modifiers to change color could be exposed in the Logger.hpp header file so that users can use them in log output if the terminal supports it, for example:
usingnamespaceRTT;log(Info) << "The word " << Logger::color_red() << "red" << Logger::color_normal() << " will be shown in red." << endlog();
I always found difficult to catch errors and/or warnings in the deployer.
Is it possible to add colors to to the Logger ?
Like red for Error and yellow for Warning.
The text was updated successfully, but these errors were encountered: