zlog: Fall back to printing module path instead of *unknown*
or just crate name (#29691)
Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
122af4fd53
commit
e3a2d52472
2 changed files with 54 additions and 26 deletions
|
@ -61,6 +61,8 @@ impl log::Log for Zlog {
|
|||
scope: module_scope,
|
||||
level,
|
||||
message: record.args(),
|
||||
// PERF(batching): store non-static paths in a cache + leak them and pass static str here
|
||||
module_path: record.module_path().or(record.file()),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -80,6 +82,7 @@ macro_rules! log {
|
|||
scope: logger.scope,
|
||||
level,
|
||||
message: &format_args!($($arg)+),
|
||||
module_path: Some(module_path!()),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -267,6 +270,7 @@ impl log::Log for Logger {
|
|||
scope: self.scope,
|
||||
level,
|
||||
message: record.args(),
|
||||
module_path: record.module_path(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue