feat: ms time resolution in log when on dev mode

This commit is contained in:
Bobby Wibowo 2022-08-03 17:26:09 +07:00
parent 0ebefe083a
commit 2f48becf23
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -10,7 +10,8 @@ const now = () => {
const parsed = {
hours: time.getHours(),
minutes: time.getMinutes(),
seconds: time.getSeconds()
seconds: time.getSeconds(),
milliseconds: time.getMilliseconds()
}
if (!short) {
@ -24,7 +25,8 @@ const now = () => {
})
return (!short ? `${time.getFullYear()}-${parsed.month}-${parsed.date} ` : '') +
`${parsed.hours}:${parsed.minutes}:${parsed.seconds}`
`${parsed.hours}:${parsed.minutes}:${parsed.seconds}` +
(short ? `.${String(parsed.milliseconds).padStart(3, '0')}` : '')
}
const clean = item => {