From 6ad7f6551a9cabfce5936bae9e148cd13d22da7a Mon Sep 17 00:00:00 2001 From: Mehrshad Date: Wed, 13 Sep 2023 14:52:09 +0330 Subject: [PATCH] logger: convert js to ts --- logger.js => logger.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename logger.js => logger.ts (82%) diff --git a/logger.js b/logger.ts similarity index 82% rename from logger.js rename to logger.ts index ada7ed8e..5c6ae185 100644 --- a/logger.js +++ b/logger.ts @@ -1,4 +1,4 @@ -const winston = require('winston'); +import * as winston from 'winston'; const level = process.env.LOG_LEVEL || 'notice'; @@ -9,9 +9,8 @@ const logger = winston.createLogger({ }), winston.format.colorize(), winston.format.printf(info => { - return `[${info.timestamp}] ${info.level}: ${info.message} ${ - info.stack ? info.stack : '' - }`; + return `[${info.timestamp}] ${info.level}: ${info.message} ${info.stack ? info.stack : '' + }`; }) ), levels: winston.config.syslog.levels, @@ -24,4 +23,5 @@ const logger = winston.createLogger({ exitOnError: false, }); -module.exports = logger; + +export { logger }; \ No newline at end of file