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
Digging deep into this great library. Two logging mods I've been manually making might be broadly useful.
Replace TAG definitions with hardcoded source filename.c with func. The functions have the file name embedded so logging their name gives more specific info and still the source file info.
Would it be possible to set colors depending on the log level. That way ERROR, WARN, DEBUG, and INFO would stand out in the stream. I am doing this manually so it works with Windows ssh terminals and gcc.
Digging deep into this great library. Two logging mods I've been manually making might be broadly useful.
Replace TAG definitions with hardcoded source filename.c with func. The functions have the file name embedded so logging their name gives more specific info and still the source file info.
Would it be possible to set colors depending on the log level. That way ERROR, WARN, DEBUG, and INFO would stand out in the stream. I am doing this manually so it works with Windows ssh terminals and gcc.
e.g.,
#define LOG_NRM "\x1B[0m"
#define LOG_ YEL "\x1B[33m"
#define LOG_RED "\x1B[31m"
#define LOG_GRN "\x1B[32m"
#define LOG_BLU "\x1B[34m"
#define LOG_MAG "\x1B[35m"
#define LOG_CYN "\x1B[36m"
#define LOG_WHT "\x1B[37m"
#define LOG_ERROR LOG_RED
These would be prepended and postpended to the format statement. Color could be specified redefining:
log_set_level(LogLevel(level, ERROR_COLOR, DEBUG_COLOR, WARN_COLOR, INFO_COLOR );
Thanks.
The text was updated successfully, but these errors were encountered: