Skip to content

Commit 6139a0d

Browse files
committed
Add date to server formatter
The browser console has timestamp options so it's not necessary there.
1 parent 40eb959 commit 6139a0d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"prepare": "tsc",
66
"test": "jest"
77
},
8-
"version": "1.1.11",
8+
"version": "1.1.15",
99
"main": "out/index.js",
1010
"types": "out/index.d.ts",
1111
"author": "Coder",

src/logger.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,12 @@ export class ServerFormatter extends Formatter {
223223
}
224224
const obj: { [key: string]: Argument} = {};
225225
fields.forEach((field) => obj[field.identifier] = field.value);
226-
console.log(format + " %s%s%s", ...args, this.style("#8c8c8c"), JSON.stringify(obj), this.reset());
226+
console.log(
227+
"[%s] " + format + " %s%s%s",
228+
new Date().toISOString(),
229+
...args,
230+
this.style("#8c8c8c"), JSON.stringify(obj), this.reset(),
231+
);
227232
}
228233
}
229234

0 commit comments

Comments
 (0)