aboutsummaryrefslogtreecommitdiff
path: root/src/utils/logger.ts
diff options
context:
space:
mode:
authorVen <vendicated@riseup.net>2022-11-14 16:22:50 +0100
committerGitHub <noreply@github.com>2022-11-14 16:22:50 +0100
commita96f8a89f36ccb980334da2274385373aa3ffb24 (patch)
treee520f3be75eb2bbd9f3c4d3427f16861b8d7ab6c /src/utils/logger.ts
parent4642b54260a2258d8d0925dcfb5c6934fcf10835 (diff)
downloadVencord-a96f8a89f36ccb980334da2274385373aa3ffb24.tar.gz
Vencord-a96f8a89f36ccb980334da2274385373aa3ffb24.tar.bz2
Vencord-a96f8a89f36ccb980334da2274385373aa3ffb24.zip
MessageLogger: fixes + ignoreSelf & ignoreBots option (#213)
Diffstat (limited to 'src/utils/logger.ts')
-rw-r--r--src/utils/logger.ts67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/utils/logger.ts b/src/utils/logger.ts
deleted file mode 100644
index 88ebb43..0000000
--- a/src/utils/logger.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Vencord, a modification for Discord's desktop app
- * Copyright (c) 2022 Vendicated and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
-*/
-
-export default class Logger {
- /**
- * Returns the console format args for a title with the specified background colour and black text
- * @param color Background colour
- * @param title Text
- * @returns Array. Destructure this into {@link Logger}.errorCustomFmt or console.log
- *
- * @example logger.errorCustomFmt(...Logger.makeTitleElements("white", "Hello"), "World");
- */
- static makeTitle(color: string, title: string): [string, ...string[]] {
- return ["%c %c %s ", "", `background: ${color}; color: black; font-weight: bold; border-radius: 5px;`, title];
- }
-
- constructor(public name: string, public color: string = "white") { }
-
- private _log(level: "log" | "error" | "warn" | "info" | "debug", levelColor: string, args: any[], customFmt = "") {
- console[level](
- `%c Vencord %c %c ${this.name} ${customFmt}`,
- `background: ${levelColor}; color: black; font-weight: bold; border-radius: 5px;`,
- "",
- `background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`
- , ...args
- );
- }
-
- public log(...args: any[]) {
- this._log("log", "#a6d189", args);
- }
-
- public info(...args: any[]) {
- this._log("info", "#a6d189", args);
- }
-
- public error(...args: any[]) {
- this._log("error", "#e78284", args);
- }
-
- public errorCustomFmt(fmt: string, ...args: any[]) {
- this._log("error", "#e78284", args, fmt);
- }
-
- public warn(...args: any[]) {
- this._log("warn", "#e5c890", args);
- }
-
- public debug(...args: any[]) {
- this._log("debug", "#eebebe", args);
- }
-}