Colored Logging

allows you to use predefined logging methods which add some color variety

目前為 2025-01-23 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/524672/1525762/Colored%20Logging.js

// ==UserScript==
// @name         Colored Logging
// @version      2025-01-23
// @description  allows you to use predefined logging methods which add some color variety
// @author       JavedPension
// ==/UserScript==


const log = new class {
    static logColor = "lightgreen";
    static warnColor = "yellow";
    static errorColor = "red";
    
    add(message) {
        console.log(`[%c*%c] ${message}`, `color: ${this.constructor.logColor};`, "color: inherit;");
    }
    
    warn(message) {
        console.log(`[%c?%c] ${message}`, `color: ${this.constructor.warnColor};`, "color: inherit;");
    }
    
    error(message) {
        console.log(`[%c!%c] ${message}`, `color: ${this.constructor.errorColor};`, "color: inherit;");
    }
}();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址