Skip to content

Commit

Permalink
Group target, module_path and file arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
EFanZh committed Aug 6, 2023
1 parent 3f534d0 commit 3985711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/__private_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ pub use std::{file, format_args, line, module_path, stringify};
pub fn log(
args: Arguments,
level: Level,
&(target, module_path, file, line): &(&str, &'static str, &'static str, u32),
&(target, module_path, file): &(&str, &'static str, &'static str),
line: u32,
kvs: Option<&[(&str, &str)]>,
) {
if kvs.is_some() {
Expand All @@ -34,7 +35,8 @@ pub fn log(
pub fn log(
args: Arguments,
level: Level,
&(target, module_path, file, line): &(&str, &'static str, &'static str, u32),
&(target, module_path, file): &(&str, &'static str, &'static str),
line: u32,
kvs: Option<&[(&str, &dyn crate::kv::ToValue)]>,
) {
crate::logger().log(
Expand Down
6 changes: 4 additions & 2 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ macro_rules! log {
$crate::__private_api::log(
$crate::__private_api::format_args!($($arg)+),
lvl,
&($target, $crate::__private_api::module_path!(), $crate::__private_api::file!(), $crate::__private_api::line!()),
&($target, $crate::__private_api::module_path!(), $crate::__private_api::file!()),
$crate::__private_api::line!(),
$crate::__private_api::Option::Some(&[$(($crate::__log_key!($key), &$value)),+])
);
}
Expand All @@ -49,7 +50,8 @@ macro_rules! log {
$crate::__private_api::log(
$crate::__private_api::format_args!($($arg)+),
lvl,
&($target, $crate::__private_api::module_path!(), $crate::__private_api::file!(), $crate::__private_api::line!()),
&($target, $crate::__private_api::module_path!(), $crate::__private_api::file!()),
$crate::__private_api::line!(),
$crate::__private_api::Option::None,
);
}
Expand Down

0 comments on commit 3985711

Please sign in to comment.