Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

Logging was briefly mentioned in README with no guidance on configuration, interpretation, or best practices. Users couldn't effectively debug or monitor Firewood.

Changes

Documentation Structure

  • Replaced 5-line logging section with comprehensive 239-line guide
  • Added subsections: Enabling, Configuration, Performance, Troubleshooting, FFI Integration

Key Content Added

Feature Flag & RUST_LOG Configuration

# Compile-time enabling
cargo build --features logger

# Runtime control with module-specific filtering
export RUST_LOG=firewood_storage=debug,info

Log Level Recommendations

  • Table mapping scenarios to levels (production → warn/error, debugging → debug/trace)
  • Module-specific filtering examples for fine-grained control

Performance Impact

  • Compile-time: Zero overhead when disabled, ~50-100KB binary increase when enabled
  • Runtime: 1-2% (warn) to 15-30% (trace) depending on log level
  • Conditional logging pattern for expensive debug info using trace_enabled()

FFI Integration

  • Go example showing StartLogs() configuration before database open
  • File-based logging defaults for FFI layer

Code Integration

use firewood_storage::logger::{debug, info, warn, error, trace};

fn operation() {
    info!("Starting operation");
    if trace_enabled() {
        trace!("Expensive debug: {:?}", compute_debug_info());
    }
}

Technical Corrections

  • Feature flag: logger (not logging)
  • Package name: firewood-fwdctl in build commands
  • References aligned with ffi/README.md and storage/src/logger.rs implementation
Original prompt

This section details on the original issue you should resolve

<issue_title>Expand logging documentation in README</issue_title>
<issue_description>### Problem
Logging is briefly mentioned in the main README and ffi/README.md, but there is no detailed guide on configuring, interpreting, or extending logging. Users don't know how to effectively use logs for debugging and monitoring.

Proposed Solution

Expand the logging section in the top-level README.md with comprehensive configuration and usage guidance.

Content to Include

  • How to enable logging with the logging feature flag
  • Setting RUST_LOG environment variable for different log levels
  • Log level recommendations for different scenarios (development, production, debugging)
  • How to configure log output destination
  • Examples of important log messages and what they mean
  • How to add logging in custom code
  • FFI-specific logging configuration (from ffi/README.md)
  • Performance considerations when logging is enabled

Current State

  • Brief mention in main README about RUST_LOG
  • FFI logging configuration documented in ffi/README.md
  • No guidance on interpreting logs or best practices

References

  • Current logging section in README.md
  • ffi/README.md Logs section
  • ffi/src/logging.rs - Logging implementation
  • env_logger documentation</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Expand logging documentation in README Expand logging documentation with comprehensive configuration and usage guide Oct 29, 2025
Copilot AI requested a review from rkuris October 29, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand logging documentation in README

2 participants