Closed qingfengxia closed 5 years ago
LOG_*
always uses named verbosity levels, but you can use VLOG_*
to pass an integer verbosity instead:
#define PROGRESS 1
VLOG_F(PROGRESS, "Working hard");
great!, you can close this issue now, sorry, I am not familiar with all API.
No problem - you can read more here: https://emilk.github.io/loguru/index.html#logging/logfunctions/vlog_f(verbosity,fmt,...)
I usually use LOG_F(), but if I want to print some "PROGRESS" or "DEBUG" information, I would use
LOG_F(1, ...)
, but it is not elegant. Because it is a macro function, I can not use#define PROGRESS 1
to avoid the log level as integer. Since C++ does not stop enum name pointing to existing value. Can you add some alias toVerbosity_1 = 1 Verbosity_PROGRESS = 1 Verbosity_VERBOSITY2 = 2
I am not sure if
Verbosity_DEBUG = 5
will cause some trouble asDEBUG
may be a common user-defined macro.loguru is really nice library! Thank you!