logger - console
Utility class to log information
Last updated
Utility class to log information
Last updated
Anacleto saves the logs of your scripts in rotating files using the json format.
The logging functionality can be accessed using both the console
and logger
classes. Both features give access to the methods log
, info
, warn
, error
all these methods allow you to pass a variable number of attributes and they will arrange themselves to create a properly formatted log.
const resp = {success: true, data : [1,2,3]}
logger.info(`Resp`, resp);
console result
Resp {success:true,data:[1,2,3]}
Log a message
console.log(msg)
Log a info level message
console.info(msg,[data..])
Log a warn level message
console.warn(msg,[data..])
Log a error level message
console.error(msg,[data..])