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
In some cases we want consola to not log to the console, but send the formatted log to something else like a blessed instance. In my understanding this is currently only possible, through custom reporters. It would be great if we could set the transport target, or be able to extend existing basic and fancy reporters.
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Can you explain with a sample code how you expect to transport (ANSI) formatted logs in an alternative way to reporters?
Normally you probably expect consistent logs and since reporters are pluggable it is almost impossible without a custom reporter for transport that formats exactly as you expect.
ideally either an option to get access to the formatted log like so:
constlogger=createConsola({transport: (log)=>{// where log is the output of the used reporter// then we can use the formatted outputsomeFunction(log)}})
or and option to extend built in reporters like so:
import{createConsola,FancyReporter}from"consola";constfancyReporter=newFancyReporter();constconsola=createConsola({reporters: [{log: (logObj)=>{constformattedLog=fancyReporter(logObj);// then we can use the formatted outputsomeFunction(log);},},],});
I might not have a perfect understanding on how everything works, so correct me if i'm overseeing something.
what do you think about this?
Describe the feature
In some cases we want consola to not log to the console, but send the formatted log to something else like a blessed instance. In my understanding this is currently only possible, through custom reporters. It would be great if we could set the transport target, or be able to extend existing basic and fancy reporters.
Additional information
The text was updated successfully, but these errors were encountered: