log4node icon indicating copy to clipboard operation
log4node copied to clipboard

Not working

Open jbmyid opened this issue 8 years ago • 0 comments

I have this simple module which is not working, Also there is no error while calling info method

"use strict";
const log4node = require("log4node");
let Logger = {
  conversation_uuid: null,
  info() {
    let _log = this.getLogger();
    _log.info.apply(_log, arguments);
  },
  error() {
    let _log = this.getLogger();
    _log.error.apply(_log, arguments);
  },
  getLogger() {
    if(this.logger){
      return this.logger;
    }else{
      let dir = process.cwd().split("/");
      return new log4node.Log4Node({ level: 'debug', file: `${dir.join("/")}/logs/conv_${this.conversation_uuid}.log`});
    }
  }
};

module.exports = Logger;

jbmyid avatar Aug 16 '17 18:08 jbmyid