你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/553735-userscript-logger-pro,源站連結 點此以跳轉

Userscript Logger Pro

Professional logging system for userscripts with history, colored labels and emoji support. Centralized logger for all your scripts.

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.org.cn/scripts/553735/1684162/Userscript%20Logger%20Pro.js

作者
MaxScorpy
版本
1.1.0
创建于
2025-10-26
更新于
2025-10-26
大小
8.1 KB
许可证
MIT

DESCRIPTION:

Professional logging system for userscripts with colored console output, emoji support and log history. Centralized logger for all your scripts.

Userscript Logger Pro - Beautiful and powerful logging library for userscripts

Features

🎨 Colored Console Output - Different colors for debug, info, success, warning, error

🎭 Emoji Support - Customizable emoji for visual script identification

📚 Log History - Stores logs in memory with timestamps

🔍 Filtering - Get logs by level or export to JSON

🌐 Universal - Works with all userscript managers

📦 Zero Dependencies - Lightweight standalone library

Quick Start

// Add to your script header:
// @require https://greasyfork.org.cn/scripts/YOUR_SCRIPT_ID/code/Userscript%20Logger%20Pro.user.js

const logger = window.MaxScorpyLogger.createLogManager({
    scriptName: 'MY-SCRIPT',
    emoji: '🚀'
});

logger.info('Script started');
logger.success('Task completed');
logger.error('Error occurred', errorObject);

Advanced Usage

// Get log history
const logs = logger.getHistory();

// Get only errors
const errors = logger.getLogsByLevel('error');

// Export to JSON
const json = logger.exportLogs();

Log Levels

🔍 debug (purple) | ℹ️ info (blue) | ✅ success (green) | ⚠️ warning (orange) | ❌ error (red)

Why Use This?

✅ Centralized logging for all your scripts

✅ Beautiful colored console output

✅ Developer-friendly simple API

✅ Production-ready with history and filtering

✅ Zero overhead, lightweight and fast

Tips

  1. Use different emoji for each script for easy visual identification
  2. Use logger.debug() for development only
  3. Export logs to JSON for detailed error analysis
  4. Track errors with logger.getLogsByLevel('error')

📌 LICENSE: MIT

📌 CATEGORY: ☑ Developer Tools

📌 TAGS: logging, logger, debug, console, developer-tools, library, utility