-
Notifications
You must be signed in to change notification settings - Fork 1
Logging
Mesbah Rafin edited this page May 14, 2022
·
1 revision
Import the index.js
file from this folder into your module and use the exported object as a generic winston logger.
const logger = require('../logger');
const exampleModule = {
exampleMethod(object, string, number, integer) {
logger.debug('Here is my object: %o', object);
logger.info('Here is my string: %s', string);
logger.warn('Here is my number: %d', number);
logger.error('Here is my integer: %i', integer);
},
};
module.exports = exampleModule;
For more information about the availible logging API, check out the winston repository's README.
Try not to print user supplied information directly, (just in case there is another log4shell exploit out there for winston
) and instead use the string interpolation with the options found here.