You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As is standard in almost all loggers in other language ecosystems, and mostly standard in modejs, it would be great to add the trace level to finish the log4j-compatible logging levels.
There may be arguments for or against it on principle, but I think for consistency's sake is the strongest reason to add it regardless. Many downstream tools expect all of these levels, and adapters/abstractions over logging do as well.
The text was updated successfully, but these errors were encountered:
I tend to use "debug" for logging key pieces of information that I think (ahead of time) will be helpful for debugging.
I use "trace" to "just dump all the info", in case I need more info later. For example, dumping the entire response from a client/server interaction. If that always ends up in "debug" output, it can make "debug" so noisy that it's difficult for debugging the common case. But I want an easy way to enable it in case I do need it later.
I'm probably going to work around this locally, by adding a {trace: true} flag to some of my statements, and filtering them out unless I enable "trace" mode in my application. But it would be a lot easier if this were just built-in. 😊
Update, here's my workaround:
asyncfunctionconfigureLogging(logLevel: LogLevel|"trace"="debug"){consttraceEnabled=logLevel=="trace"awaitlt.configure({loggers: [{// This seems to act as a root category (which is handy!)// ... but I don't see it documented anywhere.category: [],lowestLevel: logLevel=="trace" ? "debug" : logLevel,sinks: ["console"],filters: ["trace"]},{category: ["logtape","meta"],lowestLevel: "warning"},],sinks: {console: getConsoleSink(),},filters: {trace: (rec)=>traceEnabled||rec.properties.trace!==true}})}
Of course, this fake "trace" loglevel only works for my app. Libraries would have to agree on a trace property for this to work globally. Unless logtape makes it a feature. 😉
As is standard in almost all loggers in other language ecosystems, and mostly standard in modejs, it would be great to add the trace level to finish the log4j-compatible logging levels.
There may be arguments for or against it on principle, but I think for consistency's sake is the strongest reason to add it regardless. Many downstream tools expect all of these levels, and adapters/abstractions over logging do as well.
The text was updated successfully, but these errors were encountered: