Skip to content

Commit

Permalink
Merge pull request #446 from hyd-dev/format-args-capture
Browse files Browse the repository at this point in the history
Remove the `__private_api_log_lit` special case
  • Loading branch information
sfackler authored Jan 24, 2021
2 parents 1cd39c0 + 2d1a477 commit c8ab70b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
19 changes: 0 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,25 +1469,6 @@ pub fn __private_api_log(
);
}

// WARNING: this is not part of the crate's public API and is subject to change at any time
#[doc(hidden)]
pub fn __private_api_log_lit(
message: &str,
level: Level,
&(target, module_path, file, line): &(&str, &'static str, &'static str, u32),
) {
logger().log(
&Record::builder()
.args(format_args!("{}", message))
.level(level)
.target(target)
.module_path_static(Some(module_path))
.file_static(Some(file))
.line(Some(line))
.build(),
);
}

// WARNING: this is not part of the crate's public API and is subject to change at any time
#[doc(hidden)]
pub fn __private_api_enabled(level: Level, target: &str) -> bool {
Expand Down
12 changes: 0 additions & 12 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@
/// ```
#[macro_export(local_inner_macros)]
macro_rules! log {
(target: $target:expr, $lvl:expr, $message:expr) => ({
let lvl = $lvl;
if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() {
// ensure that $message is a valid format string literal
let _ = __log_format_args!($message);
$crate::__private_api_log_lit(
$message,
lvl,
&($target, __log_module_path!(), __log_file!(), __log_line!()),
);
}
});
(target: $target:expr, $lvl:expr, $($arg:tt)+) => ({
let lvl = $lvl;
if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() {
Expand Down

0 comments on commit c8ab70b

Please sign in to comment.