odebug

Macro odebug 

Source
macro_rules! odebug {
    ($($args:tt)*) => { ... };
}
Expand description

Logs debug information to files with zero runtime overhead in release builds.

In its fundamentals, it just writes to files, but it provides a flexible syntax for specifying the file name, headers, and content. It also includes some rudimentary helpful meta data, such as the file name and line number where the macro was invoked.

This macro is only active in debug builds or when the always_log feature is enabled. In release builds with no always_log feature, it compiles to nothing.

ยงExamples

Basic logging to default file:

use odebug::odebug;
odebug!("Simple debug message");
odebug!("Formatted message: {}", 42);

Custom file and headers:

use odebug::odebug;
// Log to custom file
odebug!("custom.log" => "Message in custom file");

// Using path-like syntax with headers
odebug!(custom::Header("Message with header"));

Method chaining syntax:

use odebug::odebug;
odebug!("Debug info".to_file("output.log"));
odebug!("Important message".with_header("IMPORTANT"));
odebug!("Error details".to_file("errors.log").with_header("ERROR"));