Skip to content

Commit

Permalink
logger: convert js to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho committed Dec 27, 2023
1 parent 2fbe162 commit f3d4b6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions logger.js → logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const winston = require('winston');
import winston from 'winston';

const level = process.env.LOG_LEVEL || 'notice';

Expand All @@ -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,
Expand All @@ -24,4 +23,5 @@ const logger = winston.createLogger({
exitOnError: false,
});

module.exports = logger;

export { logger };
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
}
}

0 comments on commit f3d4b6a

Please sign in to comment.