quick_tracing_derive

Crates.ioquick_tracing_derive
lib.rsquick_tracing_derive
version0.1.4
sourcesrc
created_at2024-06-02 09:16:21.319452
updated_at2024-06-02 19:31:41.811647
descriptionA simple library to easily start tracing.(derive)
homepage
repositoryhttps://github.com/SARDONYX-sard/quick_tracing
max_upload_size
id1259094
size8,676
SARDONYX (SARDONYX-sard)

documentation

README

Quick Tracing derive

This is derive. See quick_tracing

Need to write the following it in Cargo.toml

quick_tracing = { version = "0.1.4", features = ["derive"] }

Attributes

  • test: Sets the test name for the logger. Log output will be written to a file named ../../logs/{test_name}.log.
  • file: Sets the file path for the log output.
  • stdio: Enables standard I/O output for the logger.(default: true)
  • level: Sets the log level filter (e.g., TRACE, DEBUG, INFO, WARN, ERROR).

Examples

#[quick_tracing::init]
fn main() {
    tracing::debug!("Hello, world!");
}
  • Debug mode + Output file

    If there is no parent directory, it will automatically create one.

[!WARNING] Panic is a possibility.

#[quick_tracing::init(level= "DEBUG", file = "./log/test.log", stdio = false)]
fn main() {
    tracing::debug!("Hello, world!");
}
Commit count: 29

cargo fmt