Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

cuihua-logger翠花伐木工

Agent Skill

cuihua-logger 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,928

周安装

167

GitHub Stars

公开资料未说明

下载量

1,376
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cuihua-logger(翠花伐木工)
来源仓库:https://github.com/supermario11/cuihua-logger
安装命令:
openclaw skills install cuihua-logger
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install cuihua-logger

简介

cuihua-logger 是一个用于生成结构化日志的 AI 助手,可自动为代码添加合适的日志级别和内容。

  • 适合在 OpenClaw 中需要记录程序运行状态、调试问题或追踪执行流程时使用。
  • 通过 clawhub 安装后,可直接集成到项目中自动生成生产级别的日志输出。
  • 使用前需确认是否具备文件写入权限,并注意日志内容可能涉及敏感信息泄露风险。
  • 建议结合具体业务场景调整日志级别和输出格式以确保可读性和性能平衡。

SKILL.md

name
cuihua-logger
description
|
metadata
openclaw
requires
bins
env
[]
primaryEnv
null
version
1.0.0
author
翠花 (Cuihua) - ClawHub Pioneer
license
MIT
tags
capabilities

cuihua-logger - Production-Ready Logging 📝

Debug faster with intelligent, structured logging.

An AI-powered logging assistant that automatically:

  • 📝 Generates structured logs with proper context
  • 🎯 Selects appropriate log levels (debug, info, warn, error)
  • 📊 Adds performance metrics and timing
  • 🔍 Detects missing logs in critical paths
  • Optimizes log output for production

🎯 Why cuihua-logger?

The problem:

  • ❌ Too many console.log() everywhere
  • ❌ No structure, hard to search
  • ❌ Wrong log levels (everything is "info")
  • ❌ Missing context (what user? what request?)
  • ❌ Performance overhead in production

cuihua-logger solves all of this.


🚀 Quick Start

Analyze logging coverage

"Check logging coverage in src/"

Add structured logging

"Add logging to getUserById function"

Generate performance logs

"Add performance logging to API endpoints"

🎨 Features

1. Structured Logging ✨

// ❌ BEFORE - Unstructured
async function getUserById(id) {
  console.log('Getting user:', id);
  const user = await db.query('SELECT * FROM users WHERE id = $1', [id]);
  console.log('User found:', user);
  return user;
}

// ✅ AFTER - Structured
async function getUserById(id) {
  logger.info('Fetching user', { 
    userId: id,
    operation: 'getUserById'
  });
  
  const startTime = Date.now();
  const user = await db.query('SELECT * FROM users WHERE id = $1', [id]);
  const duration = Date.now() - startTime;
  
  logger.info('User fetched successfully', {
    userId: id,
    operation: 'getUserById',
    duration,
    found: !!user
  });
  
  return user;
}

2. Smart Log Levels 🎯

// Automatic level selection based on context

logger.debug('Cache hit', { key, ttl }); // Development only

logger.info('User logged in', { userId, ip }); // Important events

logger.warn('Rate limit approaching', { 
  userId, 
  current: 95, 
  limit: 100 
}); // Potential issues

logger.error('Payment failed', { 
  orderId, 
  error: error.message,
  stack: error.stack 
}); // Critical errors

3. Performance Logging ⚡

async function fetchData() {
  const timer = logger.startTimer();
  
  const data = await expensiveOperation();
  
  timer.done({ level: 'info', message: 'Operation complete' });
  
  return data;
}

// Output: "Operation complete" duration=1234ms

4. Request Tracking 🔍

app.use((req, res, next) => {
  req.requestId = generateId();
  req.logger = logger.child({ 
    requestId: req.requestId,
    method: req.method,
    path: req.path 
  });
  
  req.logger.info('Request started');
  
  res.on('finish', () => {
    req.logger.info('Request completed', {
      statusCode: res.statusCode,
      duration: Date.now() - req.startTime
    });
  });
  
  next();
});

📋 Usage Examples

Example 1: Add Logging to Function

User: "Add logging to processOrder function"

Generated:

async function processOrder(orderId, items) {
  logger.info('Processing order', { orderId, itemCount: items.length });
  
  try {
    // Validate
    if (!orderId || !items.length) {
      logger.warn('Invalid order data', { orderId, items });
      throw new ValidationError('Invalid order');
    }
    
    // Create order
    const order = await createOrder(orderId, items);
    logger.info('Order created', { orderId, orderNumber: order.number });
    
    // Process payment
    const payment = await processPayment(order);
    logger.info('Payment processed', { 
      orderId, 
      paymentId: payment.id,
      amount: payment.amount 
    });
    
    return order;
    
  } catch (error) {
    logger.error('Order processing failed', {
      orderId,
      error: error.message,
      stack: error.stack
    });
    throw error;
  }
}

Example 2: API Endpoint Logging

app.post('/api/users', async (req, res) => {
  const { logger } = req;
  
  logger.info('Creating user', { email: req.body.email });
  
  try {
    const user = await userService.create(req.body);
    
    logger.info('User created successfully', {
      userId: user.id,
      email: user.email
    });
    
    res.status(201).json(user);
    
  } catch (error) {
    logger.error('User creation failed', {
      email: req.body.email,
      error: error.message
    });
    
    res.status(500).json({ error: 'Failed to create user' });
  }
});

⚙️ Logger Configuration

Winston

import winston from 'winston';

const logger = winston.createLogger({
  level: process.env.LOG_LEVEL || 'info',
  format: winston.format.combine(
    winston.format.timestamp(),
    winston.format.errors({ stack: true }),
    winston.format.json()
  ),
  transports: [
    new winston.transports.File({ filename: 'error.log', level: 'error' }),
    new winston.transports.File({ filename: 'combined.log' })
  ]
});

Pino (fastest)

import pino from 'pino';

const logger = pino({
  level: process.env.LOG_LEVEL || 'info',
  timestamp: pino.stdTimeFunctions.isoTime,
  formatters: {
    level: (label) => ({ level: label })
  }
});

📊 Log Levels

LevelWhen to UseExample
debugDevelopment debugginglogger.debug('Cache miss', { key })
infoImportant eventslogger.info('User logged in', { userId })
warnPotential issueslogger.warn('Rate limit approaching', { userId })
errorErrors that need attentionlogger.error('Payment failed', { orderId })

💰 Pricing

Free

  • ✅ Basic log generation
  • ✅ Up to 10 files

Pro ($8/month)

  • ✅ Unlimited files
  • ✅ Performance logging
  • ✅ Request tracking
  • ✅ CI/CD integration

Enterprise ($59/month)

  • ✅ Team policies
  • ✅ Log aggregation setup
  • ✅ Custom formatters

📚 Best Practices

  1. Always log errors with context
  2. Use structured logging (objects, not strings)
  3. Include request IDs for tracing
  4. Don't log sensitive data (passwords, tokens)
  5. Use appropriate log levels

📜 License

MIT


🙏 Acknowledgments

Built with 🌸 by 翠花 (Cuihua)


Made with 🌸 | Cuihua Series | ClawHub Pioneer

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.08%
按下载量换算1,336

安全审计

VirusTotal

未展示

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills