您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Módulo de logging para WME Place Normalizer. No funciona por sí solo.
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyforks.org/scripts/548863/1657866/WME%20PLN%20Module%20-%20Logger.js
// ==UserScript== // @name WME PLN Module - Logger // @namespace https://greasyforks.org/en/users/mincho77 // @version 9.0.0 // @description Módulo de logging para WME Place Normalizer. No funciona por sí solo. // @author mincho77 // @license MIT // @grant none // ==/UserScript== // Este objeto global controlará todos los logs del script. window.PLN_LOG_CONFIG = (function (prev) { const defaults = { global_enabled: true, contexts: { 'init': true, 'scan': false, 'normalize': false, 'swap': false, 'ui': true, 'city': false, 'sdk': false, 'geo': false, 'utils': false, 'warn': true, 'error': true } }; const mergedContexts = Object.assign({}, defaults.contexts, (prev && prev.contexts) || {}); return { global_enabled: (typeof prev?.global_enabled === 'boolean') ? prev.global_enabled : defaults.global_enabled, contexts: mergedContexts }; })(window.PLN_LOG_CONFIG || null); // Función de logging que respeta la configuración global y por contexto. function plnLog(context, ...args) { // No hacer nada si el log global está deshabilitado y no es un error. if (!PLN_LOG_CONFIG.global_enabled && context !== 'error') { return; } // Verificar si el contexto específico está habilitado. if (PLN_LOG_CONFIG.contexts[context] === true) { const logFunction = (context === 'error') ? console.error : (context === 'warn') ? console.warn : console.log; logFunction(`[WME PLN][${context}]`, ...args); } }//plnLog