Skip to content

Commit

Permalink
move counters inside enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson committed Jun 4, 2024
1 parent 188797a commit dc5b213
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/aptos-logger/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ macro_rules! log {
concat!(file!(), ':', line!()),
);

match METADATA.level() {
$crate::Level::Error => { $crate::ERROR_LOG_COUNT.inc() },
$crate::Level::Warn => { $crate::WARN_LOG_COUNT.inc() },
$crate::Level::Info => { $crate::INFO_LOG_COUNT.inc() },
_ => {},
};

if METADATA.enabled() {
match METADATA.level() {
$crate::Level::Error => { $crate::ERROR_LOG_COUNT.inc() },
$crate::Level::Warn => { $crate::WARN_LOG_COUNT.inc() },
$crate::Level::Info => { $crate::INFO_LOG_COUNT.inc() },
_ => {},
};
$crate::Event::dispatch(
&METADATA,
$crate::fmt_args!($($args)+),
Expand Down

0 comments on commit dc5b213

Please sign in to comment.