aboutsummaryrefslogtreecommitdiff
path: root/node_modules/consola/src/reporters/winston.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/consola/src/reporters/winston.js')
-rw-r--r--node_modules/consola/src/reporters/winston.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/consola/src/reporters/winston.js b/node_modules/consola/src/reporters/winston.js
new file mode 100644
index 00000000..88c821fd
--- /dev/null
+++ b/node_modules/consola/src/reporters/winston.js
@@ -0,0 +1,26 @@
+// This reporter is compatible with Winston 3
+// https://github.com/winstonjs/winston
+
+export default class WinstonReporter {
+ constructor (logger) {
+ this.logger = logger
+ }
+
+ log (logObj) {
+ this.logger.log({
+ level: levels[logObj.level] || 'info',
+ label: logObj.tag,
+ message: logObj.message,
+ timestamp: logObj.date.getTime() / 1000
+ })
+ }
+}
+
+const levels = {
+ 0: 'error',
+ 1: 'warn',
+ 2: 'info',
+ 3: 'verbose',
+ 4: 'debug',
+ 5: 'silly'
+}