Skip to main content

is_enabled_with_config

Function is_enabled_with_config 

Source
pub fn is_enabled_with_config(config: Option<&ExecutionLogConfig>) -> bool
Expand description

Check if execution log is enabled with optional config override.

This is the preferred function for code that needs testability or programmatic control over execution logging.

§Arguments

  • config - Optional configuration override.
    • None: Uses ExecutionLogConfig::from_env() (reads environment variable)
    • Some(config): Uses the provided configuration

§Examples

use splice::execution::log::{is_enabled_with_config, ExecutionLogConfig};

// Default behavior (respects environment variable)
let enabled = is_enabled_with_config(None);

// Explicit control (useful for testing)
let config = ExecutionLogConfig::disabled();
let enabled = is_enabled_with_config(Some(&config));