Skip to content

Commit

Permalink
add CONFG.LOG_DATE_FORMAT
Browse files Browse the repository at this point in the history
  • Loading branch information
nleush committed Jan 12, 2023
1 parent 2163adc commit afdf4b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@
providerOptions: {
"readability": {},
"twitter.status": {}
}
},

LOG_DATE_FORMAT: "\\[YY-MM-DD HH:mm:ss\\]:"
};

// Providers config loader.
Expand Down
6 changes: 5 additions & 1 deletion logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export default function log() {
}
}

args.splice(0, 0, "--", moment().utc().format("\\[YY-MM-DD HH:mm:ss\\]:") + process.pid);
if (CONFIG.LOG_DATE_FORMAT) {
args.splice(0, 0, "--", moment().utc().format(CONFIG.LOG_DATE_FORMAT) + process.pid);
} else {
args.splice(0, 0, "--", "pid:" + process.pid);
}

console.log.apply(console, args);
};

0 comments on commit afdf4b4

Please sign in to comment.