mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-07 14:41:09 +08:00
separate log functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const PrometheusClient = require("prom-client");
|
||||
const { log } = require("../src/util");
|
||||
const { log_error } = require("../src/util");
|
||||
|
||||
const commonLabels = [
|
||||
"monitor_name",
|
||||
@@ -57,23 +57,23 @@ class Prometheus {
|
||||
}
|
||||
monitor_cert_is_valid.set(this.monitorLabelValues, is_valid);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
|
||||
try {
|
||||
monitor_cert_days_remaining.set(this.monitorLabelValues, tlsInfo.certInfo.daysRemaining);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
monitor_status.set(this.monitorLabelValues, heartbeat.status);
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -84,8 +84,8 @@ class Prometheus {
|
||||
monitor_response_time.set(this.monitorLabelValues, -1);
|
||||
}
|
||||
} catch (e) {
|
||||
log("prometheus", "Caught error", "error");
|
||||
log("prometheus", e, "error");
|
||||
log_error("prometheus", "Caught error");
|
||||
log_error("prometheus", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user