Skip to content

Commit dffc94d

Browse files
authored
patina_adv_logger: Check for logging static max level in integration test (#1306)
When the platform statically disables info level logging, the integration test was still expecting to find info level logs and would fail. This change checks for the static max level and if info level logging is disabled, it ignores the direct message checks. OpenDevicePartnership/patina-qemu#167
1 parent e013eee commit dffc94d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/patina_adv_logger/src/integration_test.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ fn adv_logger_test(bs: StandardBootServices) -> patina::test::Result {
6161
let log_info = log.unwrap();
6262
let mut direct_found = false;
6363
let mut protocol_found = false;
64+
65+
// Check if direct info logs have been explicitly disabled, if so just ignore the direct message checks.
66+
if log::STATIC_MAX_LEVEL < log::LevelFilter::Info {
67+
direct_found = true;
68+
}
69+
6470
for entry in log_info.iter() {
6571
// skip any messages that aren't valid UTF-8, we only care about the messages we just logged
6672
let Ok(log_str) = core::str::from_utf8(entry.get_message()) else { continue };

0 commit comments

Comments
 (0)