pw_log: Add compile-time log filtering
This adds compile-time log filtering to the facade, controlled by
macros. By default there is a simple PW_LOG_LEVEL macro that controls
logs by level; and a more involved PW_LOG_ENABLE_IF(level, flags) macro
that can do more sophisticated logic if needed.
Change-Id: I3613ffe3f7cd34c6da5cc17e592725c251bdd775
diff --git a/pw_unit_test/logging_event_handler.cc b/pw_unit_test/logging_event_handler.cc
index bd063a2..e1ad080 100644
--- a/pw_unit_test/logging_event_handler.cc
+++ b/pw_unit_test/logging_event_handler.cc
@@ -64,14 +64,17 @@
const char* result = expectation.success ? "Success" : "Failure";
uint32_t level = expectation.success ? PW_LOG_LEVEL_INFO : PW_LOG_LEVEL_ERROR;
PW_LOG(level,
- PW_LOG_NO_FLAGS,
+ PW_LOG_DEFAULT_FLAGS,
"%s:%d: %s",
test_case.file_name,
expectation.line_number,
result);
- PW_LOG(level, PW_LOG_NO_FLAGS, " Expected: %s", expectation.expression);
PW_LOG(level,
- PW_LOG_NO_FLAGS,
+ PW_LOG_DEFAULT_FLAGS,
+ " Expected: %s",
+ expectation.expression);
+ PW_LOG(level,
+ PW_LOG_DEFAULT_FLAGS,
" Actual: %s",
expectation.evaluated_expression);
}