Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/__private_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ impl Log for GlobalLogger {
}
}

// Split from `log` to reduce generics and code size
// Split from `log` to reduce generics and code size.
// Being generic over the logger, it gets inlined into callsites without the attribute
#[inline(never)]
fn log_impl<L: Log>(
logger: L,
args: Arguments,
level: Level,
&(target, module_path, loc): &(&str, &'static str, &'static Location),
&(target, module_path): &(&str, &'static str),
loc: &'static Location,
kvs: Option<&[(Key, Value)]>,
) {
#[cfg(not(feature = "kv"))]
Expand Down Expand Up @@ -87,7 +90,8 @@ pub fn log<'a, K, L>(
logger: L,
args: Arguments,
level: Level,
target_module_path_and_loc: &(&str, &'static str, &'static Location),
target_and_module_path: &(&str, &'static str),
loc: &'static Location,
kvs: K,
) where
K: KVs<'a>,
Expand All @@ -97,7 +101,8 @@ pub fn log<'a, K, L>(
logger,
args,
level,
target_module_path_and_loc,
target_and_module_path,
loc,
kvs.into_kvs(),
)
}
Expand Down
6 changes: 4 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ macro_rules! __log {
$logger,
$crate::__private_api::format_args!($($arg)+),
lvl,
&($target, $crate::__private_api::module_path!(), $crate::__private_api::loc()),
&($target, $crate::__private_api::module_path!()),
$crate::__private_api::loc(),
&[$(($crate::__log_key!($key), $crate::__log_value!($key $(:$capture)* = $($value)*))),+] as &[_],
);
}
Expand All @@ -139,7 +140,8 @@ macro_rules! __log {
$logger,
$crate::__private_api::format_args!($($arg)+),
lvl,
&($target, $crate::__private_api::module_path!(), $crate::__private_api::loc()),
&($target, $crate::__private_api::module_path!()),
$crate::__private_api::loc(),
(),
);
}
Expand Down
Loading