From 5d13783ed5d5714a290483dfe60a63c3d826f87c Mon Sep 17 00:00:00 2001 From: rxbn_ Date: Fri, 14 Aug 2020 13:26:07 +0200 Subject: [PATCH] logs - load config directly in module --- bin/logs/module.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/logs/module.js b/bin/logs/module.js index 0c98b60..2560f1a 100644 --- a/bin/logs/module.js +++ b/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",