Skip to content

Logging: Implement structured logging and configurable log levels #33

Description

@0xDevNinja

Summary

To elevate the project to an industry level, we need comprehensive logging across modules. Add structured logging to capture key events, errors, and metrics.

Tasks

  • Add log and env_logger dependencies to Cargo.toml with appropriate features.
  • Create a new module src/logging/mod.rs that exposes a function init_logging() which initializes the logger using env_logger.
  • Configure the logger to read log level from the RUST_LOG environment variable with a sensible default (e.g. info).
  • Use log::info!, log::debug!, log::warn!, and log::error! macros in critical modules (solver, matching, routing, pricing, adapters, bridge, strategies) to record lifecycle events, decisions, and errors.
  • Update the CLI binary and daemon service to call logging::init_logging() at startup.
  • Add documentation to the README explaining how to set RUST_LOG for different environments and how to interpret logs.
  • Provide unit tests (or integration tests) that verify logging initialization does not panic and respects log level configuration.

Acceptance Criteria

  • When running the solver or daemon, logs are printed to stdout with timestamps and module names.
  • Changing RUST_LOG=debug in the environment enables debug-level logs.
  • The logger must not impede performance or crash the application.
  • The README is updated with logging instructions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions