From a29839220de5955c84f7d2969f2f36da2a6c3d45 Mon Sep 17 00:00:00 2001 From: Adam Horden Date: Thu, 19 Aug 2021 23:58:23 +0100 Subject: [PATCH] [#13] Feature: Improve Logging --- lib/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index e5aba32..8f2578a 100755 --- a/lib/index.js +++ b/lib/index.js @@ -1,8 +1,19 @@ #!/usr/bin/env node -/* eslint-disable import/newline-after-import */ -import logger from 'winston'; import { createBots } from './helpers'; +const winston = require('winston'); + +/* [REFACTOR] Do not hard code log file path. */ + +const logger = winston.createLogger({ + level: 'info', + format: winston.format.json(), + transports: [ + new winston.transports.Console(), + new winston.transports.File({ filename: '/var/log/slack_irc' }) + ] +}); + /* istanbul ignore next */ if (process.env.NODE_ENV === 'development') { logger.level = 'debug';