Skip to content

Commit 9d7080a

Browse files
committed
fix: panic when calling /cpu-config with log level set to debug
Due to use of the log_enabled! macro to determine the verbosity of a log message, a call to Logger::enabled(...) was made by the logging framework, if log verbosity was at least Debug (the macro first checks if the global log level allows Debug, and if yes, calls to Log::enabled to see if there are any custom constraints by the `Log` instance). As our implementation of `Log::enabled` was simply `unimplemented!()`, we got a panic. Signed-off-by: Patrick Roy <[email protected]>
1 parent 9424fb8 commit 9d7080a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/logger/src/logger.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,9 @@ pub enum LoggerError {
400400

401401
/// Implements the "Log" trait from the externally used "log" crate.
402402
impl Log for Logger {
403-
// This is currently not used.
404403
fn enabled(&self, _metadata: &Metadata) -> bool {
405-
unreachable!();
404+
// No filtering beyond what the log crate already does based on level.
405+
true
406406
}
407407

408408
fn log(&self, record: &Record) {

0 commit comments

Comments
 (0)