Optional
globalOptional
loggerObject containing an array of [LoggerProcessors]LoggerProcessor to be called after console log when ILoggerConfig.useLoggerProcessors is true
Optional
logAny value from LogLevelsEnum defaults to LogLevelsEnum.DEBUG
Optional
prefixThe prefix to be appended before the log message
Optional
prefixA valid CSS string color for the prefix (where it is supported). Examples: red | #ffbbss | rgb(255,10,2) | rgba(255,10,2,1)
Optional
showPrints the logger name after after the log contents (except for .dir)
const logger = new SaninnLogger({
showLoggerFunctionNames: true
});
logger.log('test') // --> [LOG]: test
* const logger = new SaninnLogger({
prefix: 'my-logger',
showLoggerFunctionNames: true
});
logger.log('test')
Optional
useIf active the function declared on globalPreLoggerFunctions will be called before every loggerProcessor and console function. It DOES NOT Prevent the console to print the correct call line
Optional
useIf active the array of functions on ILoggerConfig.loggerProcessors will be called before every console function, util if you need to send the logs to third party libs or analytics services. IMPORTANT: when this is enabled the SaninnLogger will lose the console position because there is no way to get the console message without proxy it.
This function will be called before the console prints their output when ILoggerConfig.useGlobalPreLoggerFunctions is true