status-im / nim-chronicles

A crafty implementation of structured logging for Nim.
Apache License 2.0
161 stars 20 forks source link

feat: allow string input for setLogLevel #136

Open AuHau opened 1 year ago

AuHau commented 1 year ago

If you use parseTopicDirectives then it allows to use log levels as strings which can be lowercased or even shortened. But if you want to set top-level logging level then you have to use the parseEnum utility which is IMHO bad API, so I want to introduce another override for setLogLevel which allows to take string in any casing.

arnetheduck commented 10 months ago

Sounds reasonable, but instead of a setLogLevel overload, it feels like it's the log level parser that should be exposed (ie proc parse(_: type LogLevel, v: openArray[char]): LogLevel or something like that) - wdyt?