Browse Source

logs - load config directly in module

master
Ruben Meyer 2 years ago
parent
commit
5d13783ed5
Signed by: rxbn_ GPG Key ID: BE3BF898BE352FE2
  1. 5
      bin/logs/module.js

5
bin/logs/module.js

@ -2,12 +2,13 @@ var methods = {};
let fs = require('fs');
let util = require('util');
var cfg = require(global['__dirname']+'/bin/config');
// save new line to file
newLine = (prefix, obj) => {
let date = new Date(); // current date
let filename = global['gds'].cfg.log.filename(); // filename
let dir = global['gds'].cfg.log.directory(); // directory
let filename = cfg.log.filename(); // filename
let dir = cfg.log.directory(); // directory
let path = dir + filename; // filepath
let fs_options = { // fs options for encoding, file mode and file flag
encoding: "utf8",

Loading…
Cancel
Save