From 5142da761d9449aa4ef832495706dac5dd049233 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Fri, 12 May 2017 20:24:48 +0300 Subject: [PATCH] app log time format fix --- routes/shepherd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/shepherd.js b/routes/shepherd.js index 5d77f25..845872e 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -103,13 +103,13 @@ shepherd.writeLog = function(data) { const timeFormatted = new Date(Date.now()).toLocaleString().replace('AM', '').replace('PM', ''); if (fs.existsSync(logLocation + '/agamalog.txt')) { - fs.appendFile(logLocation + '/agamalog.txt', new Date(Date.now()).toLocaleString() + ' ' + data + '\r\n', function (err) { + fs.appendFile(logLocation + '/agamalog.txt', timeFormatted + ' ' + data + '\r\n', function (err) { if (err) { console.log('error writing log file'); } }); } else { - fs.writeFile(logLocation + '/agamalog.txt', new Date(Date.now()).toLocaleString() + ' ' + data + '\r\n', function (err) { + fs.writeFile(logLocation + '/agamalog.txt', timeFormatted + ' ' + data + '\r\n', function (err) { if (err) { console.log('error writing log file'); }