Module logging

Source
Expand description

Logging utilities for Foxy.

This module provides centralized logging configuration and helper functions for consistent logging throughout the application.

Two logging systems are supported:

  1. Traditional logging via env_logger (default)
  2. Structured logging via slog with JSON output support

Modules§

config
Configuration for logging.
middleware
HTTP middleware for request/response logging with trace context.
structured
Structured logging implementation for Foxy.
test_logger
wrapper
Logging wrapper macros that route all messages to the standard log facade. The slog_stdlog bridge (configured in structured.rs) handles forwarding to slog when structured logging is enabled. This unified approach is simpler and more robust.

Functions§

init_with_config
Initialize logging with the specified level and configuration.
is_structured_logging
Check if structured logging is enabled
log_debug
Log a debug message with context.
log_error
Log an error with context and return the error.
log_info
Log an info message with context.
log_trace
Log a trace message with context.
log_warning
Log a warning with context.
log_with_context
Log a message with additional context fields