Userscript Logger Pro

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

目前為 2025-10-26 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/553735/1684012/Userscript%20Logger%20Pro.js

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
MaxScorpy
版本
1.0.0
建立日期
2025-10-26
更新日期
2025-10-26
尺寸
7.0 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/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