mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-25 13:44:09 -08:00
Fix #2472
This commit is contained in:
parent
4a1db336df
commit
1b6c587cc9
|
@ -106,7 +106,13 @@ class Logger {
|
|||
}
|
||||
module = module.toUpperCase();
|
||||
level = level.toUpperCase();
|
||||
const now = dayjs.tz(new Date()).format();
|
||||
let now;
|
||||
if (dayjs.tz) {
|
||||
now = dayjs.tz(new Date()).format();
|
||||
}
|
||||
else {
|
||||
now = dayjs().format();
|
||||
}
|
||||
const formattedMessage = (typeof msg === "string") ? `${now} [${module}] ${level}: ${msg}` : msg;
|
||||
if (level === "INFO") {
|
||||
console.info(formattedMessage);
|
||||
|
|
|
@ -122,7 +122,12 @@ class Logger {
|
|||
module = module.toUpperCase();
|
||||
level = level.toUpperCase();
|
||||
|
||||
const now = dayjs.tz(new Date()).format();
|
||||
let now;
|
||||
if (dayjs.tz) {
|
||||
now = dayjs.tz(new Date()).format();
|
||||
} else {
|
||||
now = dayjs().format();
|
||||
}
|
||||
const formattedMessage = (typeof msg === "string") ? `${now} [${module}] ${level}: ${msg}` : msg;
|
||||
|
||||
if (level === "INFO") {
|
||||
|
|
Loading…
Reference in a new issue