Skip to content

Conversation

@DanielBoye
Copy link

What

Implements the set_log_level and set_log_categories RPC endpoints that were previously marked with todo!(). These handlers allow dynamic adjustment of logging levels and categories via RPC, matching monerod's behavior.

Why

These endpoints are part of the standard Monero RPC API and enable dynamic log level adjustment without restarting the daemon, ensuring compatibility with existing Monero tooling.

Where

  • binaries/cuprated/src/rpc/handlers/other_json.rs
    • Implemented set_log_level handler
    • Implemented set_log_categories handler
    • Updated request routing to call these handlers instead of not_available()

How

  • set_log_level: Maps Monero log level numbers (0-4) to Rust's tracing::LevelFilter (ERROR, WARN, INFO, DEBUG, TRACE) following the monerod implementation. Updates both stdout and file logging filters.

  • set_log_categories: Parses category strings in EnvFilter format (e.g., "*:INFO", "net:DEBUG") following the monerod implementation. Extracts the log level and applies it to both logging outputs, defaulting to INFO if parsing fails.

Both handlers follow existing code patterns and error handling conventions.

@github-actions github-actions bot added the A-binaries Area: Related to binaries. label Dec 30, 2025
@DanielBoye DanielBoye changed the title rpc: implement set_log_level and set_log_categories handlers rpc: implement set_log_level and set_log_categories handlers Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-binaries Area: Related to binaries.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant