Skip to content

Commit ccef50b

Browse files
committed
Add date when there are no fields as well
1 parent 6139a0d commit ccef50b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-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.15",
8+
"version": "1.1.16",
99
"main": "out/index.js",
1010
"types": "out/index.d.ts",
1111
"author": "Coder",

src/logger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ export class ServerFormatter extends Formatter {
219219

220220
protected doWrite(format: string, args: string[], fields: Array<Field<Argument>>): void {
221221
if (fields.length === 0) {
222-
return console.log(format, ...args);
222+
return console.log(
223+
"[%s] " + format,
224+
new Date().toISOString(),
225+
...args
226+
);
223227
}
224228
const obj: { [key: string]: Argument} = {};
225229
fields.forEach((field) => obj[field.identifier] = field.value);

0 commit comments

Comments
 (0)