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
constlogger=createLogger({level: 'done',// Log up to the "done" leveltarget: [json(),// Write JSON logs for all levels that are <= "done" (without any additional restrictions){level: 'warn',// Exclude logs higher than the "warn" leveltarget: json({target: myFile})}]});
However, they cannot define the minimum or exclusive logic for them, resulting in the inability to define a flow for unnecessary or specific logs.
For example, we want to redirect all debug logs to the file. Additionally, all logs except for "error" should be sent to stdout, while "error" logs should be directed to stderr.
API Proposal
constlogger=createLogger({name: 'my-app',// Define the global maximum level of logs that will be processedlevel: process.env.NODE_ENV==='production' ? 'done' : 'debug',target: [// handle all logshandleAllLogs,{// handle only 'warn' and 'error' logslevel: 'warn',target: handleWarnLogs},{// handle 'warn', 'info' and 'done' logslevel: {min: 'warn',max: 'done'},target: handleRegularLogs},{// handle only 'debug' logslevel: {min: 'debug',max: 'debug'},target: handleDebugLogs}]});
The text was updated successfully, but these errors were encountered:
Currently, users can only specify the
max
level.However, they cannot define the minimum or exclusive logic for them, resulting in the inability to define a flow for unnecessary or specific logs.
For example, we want to redirect all debug logs to the file. Additionally, all logs except for "error" should be sent to
stdout
, while "error" logs should be directed tostderr
.API Proposal
The text was updated successfully, but these errors were encountered: