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
Right now you have to set the log level via the constructor like so:
constaioLogger=require('@adobe/aio-lib-core-logging')('App',{level: 'info'})functionmain(params){// you can't set the log level here, it is already fixed to `info` above// thus .debug won't output anythingaioLogger.debug('this will not output anything')}
Proposed setLogLevel feature
constaioLogger=require('@adobe/aio-lib-core-logging')('App')functionmain(params){// the log level is by default `info` and you can't change it after construction,// unless you add this feature like soaioLogger.setLogLevel(params.LOG_LEVEL)// if params.LOG_LEVEL was 'debug', now debug logs will show in the outputaioLogger.debug('this will output if params.LOG_LEVEL is debug')}
Workaround
The workaround is to create the logger with the log level, in your function scope.
constcoreLogger=require('@adobe/aio-lib-core-logging')functionmain(params){constaioLogger=coreLogger('App',{level: params.LOG_LEVEL})// if params.LOG_LEVEL was 'debug', debug logs will show in the outputaioLogger.debug('this will output if params.LOG_LEVEL is debug')}
The text was updated successfully, but these errors were encountered:
Description
Right now you have to set the log level via the constructor like so:
Proposed
setLogLevel
featureWorkaround
The workaround is to create the logger with the log level, in your function scope.
The text was updated successfully, but these errors were encountered: