Skip to content

Commit 09b6c57

Browse files
committed
Manually add millis to log output.
This re-enabled support for Node v12
1 parent a8ae5b0 commit 09b6c57

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [14.x, 16.x, 17.x]
19+
node-version: [12.x, 14.x, 16.x, 17.x]
2020
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2121

2222
steps:

src/injected/logger.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
const timestamp = () => new Date().toLocaleTimeString('en-US', {
2-
hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit', fractionalSecondDigits: 3
3-
} as Intl.DateTimeFormatOptions)
1+
const timestamp = () => {
2+
const d = new Date()
3+
return d.toLocaleTimeString('en-US', {
4+
hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit'
5+
}) + "." + d.getMilliseconds()
6+
}
47

58
export const log = (...message: string[]) => console.log("[pcf-reloader]", "[" + timestamp() + "]", ...message)

0 commit comments

Comments
 (0)