Revert "feat: structured logging (JSON)" (#5175)

This commit is contained in:
Louis Lam
2024-10-09 07:43:44 +08:00
committed by GitHub
parent 4829ad8c5d
commit eca90a2b00
27 changed files with 239 additions and 186 deletions

View File

@@ -1,8 +1,7 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { setSettings, setting } = require("../util-server");
const { getMonitorRelativeURL, UP } = require("../../src/util");
const { Settings } = require("../settings");
const { log } = require("../../src/util");
class Slack extends NotificationProvider {
name = "slack";
@@ -15,13 +14,15 @@ class Slack extends NotificationProvider {
* @returns {Promise<void>}
*/
static async deprecateURL(url) {
let currentPrimaryBaseURL = await Settings.get("primaryBaseURL");
let currentPrimaryBaseURL = await setting("primaryBaseURL");
if (!currentPrimaryBaseURL) {
log.error("notification", "Move the url to be the primary base URL");
await Settings.set("primaryBaseURL", url, "general");
console.log("Move the url to be the primary base URL");
await setSettings("general", {
primaryBaseURL: url,
});
} else {
log.debug("notification", "Already there, no need to move the primary base URL");
console.log("Already there, no need to move the primary base URL");
}
}
@@ -135,7 +136,7 @@ class Slack extends NotificationProvider {
return okMsg;
}
const baseURL = await Settings.get("primaryBaseURL");
const baseURL = await setting("primaryBaseURL");
const title = "Uptime Kuma Alert";
let data = {