We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc928f2 commit 0bf312eCopy full SHA for 0bf312e
lib/logger.js
@@ -8,6 +8,8 @@ const COLORS = {
8
error: '\x1b[0;31m',
9
};
10
11
+const DATETIME_LENGTH = 19;
12
+
13
class Logger {
14
constructor(logPath, threadId = 0) {
15
this.path = logPath;
@@ -18,7 +20,8 @@ class Logger {
18
20
}
19
21
22
write(level = 'info', s) {
- const date = new Date().toISOString();
23
+ const now = new Date().toISOString();
24
+ const date = now.substring(0, DATETIME_LENGTH);
25
const color = COLORS[level];
26
const line = date + '\t' + s;
27
console.log(color + line + '\x1b[0m');
0 commit comments