Closed jspc closed 2 years ago
@icexin :recycle:
I've written a setter with bounds checking (with some tests) and made it accept an explicit log level type. I've left the init()
function alone, so it still sets log.Level
directly, since it does it's own bounds checking1
When running applications on platforms where there is no environment, calls to
os.Setenv
to set a loglevel have inconsistent results. Similarly, setting this environment variable before the first log event, and thus making that call moot, is racy.Instead, then, export log levels, drop the potential stutter in
log.LogLvl
tolog.Level
, and allow implementations/ callers of this package to set a log level accordingly, while maintaining the default behaviour