-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds details on the current function scope.
- Loading branch information
Jonathan Woollett-Light
committed
Oct 12, 2023
1 parent
859e16c
commit d591852
Showing
10 changed files
with
199 additions
and
168 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use log::*; | ||
|
||
fn main() { | ||
env_logger::builder() | ||
.filter_level(LevelFilter::Trace) | ||
.init(); | ||
info!("{}", one(2)); | ||
info!("{}", one(3)); | ||
info!("{}", one(4)); | ||
} | ||
#[log_instrument::instrument] | ||
fn one(x: u32) -> u32 { | ||
let cmp = x == 2; | ||
debug!("cmp: {cmp}"); | ||
if cmp { | ||
return 4; | ||
} | ||
two(x + 3) | ||
} | ||
#[log_instrument::instrument] | ||
fn two(x: u32) -> u32 { | ||
let res = x % 2; | ||
debug!("res: {res}"); | ||
res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.