Hi! We're using consola in our Nuxt 3 applications and send logs to Datadog.
When using the JSONReporter, json logs have a level property that maps to a number (enum LogLevel) and a type property that maps to a string (type logType).
It seems that Datadog uses the level property to classify the logs between error, warn, log, etc, but only when it's mapped to string types such as error, warn, log, etc. It's not working when using numbers and most logs are interpreted as error.
I've implemented a custom JSONReporter to use the level property as a string:
Describe the feature
Hi! We're using consola in our Nuxt 3 applications and send logs to Datadog.
When using the
JSONReporter
, json logs have alevel
property that maps to a number (enumLogLevel
) and atype
property that maps to a string (typelogType
).It seems that Datadog uses the
level
property to classify the logs betweenerror
,warn
,log
, etc, but only when it's mapped to string types such aserror
,warn
,log
, etc. It's not working when using numbers and most logs are interpreted aserror
.I've implemented a custom
JSONReporter
to use thelevel
property as a string:Would that make sense for the built-in
JSONReporter
to support this feature out of the box?Additional information