Logger is in global namespace
raub opened this issue · comments
The LabSound logger API is not contained in lab::
- so it may conflict with whichever other logger having a log_set_level
function, or some others.
PS. I was able to do log_set_level(LOGLEVEL_WARN);
in my project, but shouldn't it be the default?
That logging library is meant for C, so probably it should be moved to cpp, with a namespace as you suggest. Also, it relies on zero initialization of the L
struct, which should yield a default log level of TRACE
, but I agree with you that WARN
is a reasonable default.
Otherwise, you could mention changing the log-level in the doc as a normal step of library initialization.
If that's for C, a prefix would be fine too. Zero-init would still work if some of the enum members go negative.