From 199d070792c9b83e9687c244b29fc128f27eba38 Mon Sep 17 00:00:00 2001 From: rxbn_ <46384706+rxbnDE@users.noreply.github.com> Date: Sun, 30 Jun 2019 20:59:32 +0200 Subject: [PATCH] logging bugfix --- bin/config.js | 4 +++- bin/logs/module.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/config.js b/bin/config.js index 008bb22..f99b541 100644 --- a/bin/config.js +++ b/bin/config.js @@ -9,7 +9,9 @@ module.exports = { log: { - directory: global['__dirname'] + "/logs/", + directory: () => { + return global['__dirname'] + "/logs/" + }, filename: () => { return (new Date()).toISOString().substr(0, 10) + ".log" } diff --git a/bin/logs/module.js b/bin/logs/module.js index 3e5e1e6..6fd2be4 100644 --- a/bin/logs/module.js +++ b/bin/logs/module.js @@ -15,7 +15,7 @@ let util = require('util'); 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 dir = global['gds'].cfg.log.directory(); // directory let path = dir + filename; // filepath let fs_options = { // fs options for encoding, file mode and file flag encoding: "utf8",