diff --git a/lib/winston/create-logger.js b/lib/winston/create-logger.js index 1c06f7b14..bb6d13964 100644 --- a/lib/winston/create-logger.js +++ b/lib/winston/create-logger.js @@ -46,7 +46,7 @@ class DerivedLogger extends Logger { // Define prototype methods for each log level // e.g. logger.log('info', msg) <––> logger.info(msg) & logger.isInfoEnabled() // this is not an arrow function so it'll always be called on the instance instead of a fixed place in the prototype chain. - this[level] = function (...args) { + this[level] = (...args) => { // Optimize the hot-path which is the single object. if (args.length === 1) { const [msg] = args;