3 releases

0.1.2 Dec 8, 2023
0.1.1 Nov 3, 2023
0.1.0 Oct 30, 2023

#1185 in Rust patterns

Download history 42/week @ 2024-01-05 44/week @ 2024-01-12 25/week @ 2024-01-19 15/week @ 2024-01-26 44/week @ 2024-02-02 25/week @ 2024-02-09 43/week @ 2024-02-16 64/week @ 2024-02-23 35/week @ 2024-03-01 33/week @ 2024-03-08 48/week @ 2024-03-15 33/week @ 2024-03-22 67/week @ 2024-03-29 25/week @ 2024-04-05 22/week @ 2024-04-12 33/week @ 2024-04-19

162 downloads per month

MIT license

4KB

FireDBG Support Library

fire::dbg!

This macro allows you to capture the value of a variable via runtime inspection in FireDBG.

Usage example:

use firedbg_lib::fire;

fn some_fn(v: i32) -> i32 {
    fire::dbg!(v) + 1
}

fn other_fn(v: i32) -> i32 {
    fire::dbg!("arg_v", v) + 1
}

Which fire::dbg!(v) would expand to __firedbg_trace__("v", v) when compiled under debug mode. The label could be customized, which fire::dbg!("arg_v", v) would expand to __firedbg_trace__("arg_v", v). In release mode, it would expand to an expression passing through the value, i.e. { v }.

Note that the function passes through the ownership of the variable, just like the std::dbg! macro.

fn __firedbg_trace__<T>(name: &'static str, v: T) -> T { v }

lib.rs:

FireDBG Support Library

fire::dbg!

This macro allows you to capture the value of a variable via runtime inspection in FireDBG.

Usage example:

use firedbg_lib::fire;

fn some_fn(v: i32) -> i32 {
    fire::dbg!(v) + 1
}

fn other_fn(v: i32) -> i32 {
    fire::dbg!("arg_v", v) + 1
}

Which fire::dbg!(v) would expand to __firedbg_trace__("v", v) when compiled under debug mode. The label could be customized, which fire::dbg!("arg_v", v) would expand to __firedbg_trace__("arg_v", v). In release mode, it would expand to an expression passing through the value, i.e. { v }.

Note that the function passes through the ownership of the variable, just like the std::dbg! macro.

fn __firedbg_trace__<T>(name: &'static str, v: T) -> T { v }

No runtime deps