feat(bot): add NodeJS implementation and deploy script
This commit is contained in:
17
src/utils/logger.js
Normal file
17
src/utils/logger.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const winston = require('winston');
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
|
||||
winston.format.printf(info => `${info.timestamp} ${info.level.toUpperCase()}: ${info.message}`)
|
||||
),
|
||||
transports: [
|
||||
new winston.transports.Console(),
|
||||
// Optionally add file transport
|
||||
// new winston.transports.File({ filename: 'combined.log' }),
|
||||
// new winston.transports.File({ filename: 'error.log', level: 'error' }),
|
||||
],
|
||||
});
|
||||
|
||||
module.exports = logger;
|
||||
Reference in New Issue
Block a user