Skip to content

Commit

Permalink
[#13]
Browse files Browse the repository at this point in the history
Feature: Improve Logging
  • Loading branch information
adamhorden committed Aug 19, 2021
1 parent a549f5a commit a298392
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit a298392

Please sign in to comment.