701c644408
Replace log_message with log_debug/info/warn/err and a level filter controlled by logger_set_level. Extract the printf sink into log_write so CMock can intercept it in test_logger. Add 9 tests covering emit and suppression behaviour per level.
19 lines
885 B
CMake
19 lines
885 B
CMake
add_library(ctdd_str STATIC str.c)
|
|
target_include_directories(ctdd_str PUBLIC "${CMAKE_SOURCE_DIR}")
|
|
target_compile_features(ctdd_str PRIVATE c_std_23)
|
|
|
|
# Reporter — calls log_info(); symbol resolved by the final binary
|
|
add_library(ctdd_report STATIC report.c)
|
|
target_include_directories(ctdd_report PUBLIC "${CMAKE_SOURCE_DIR}")
|
|
target_compile_features(ctdd_report PRIVATE c_std_23)
|
|
|
|
# Level-filtering logger — calls log_write(); symbol resolved by the final binary
|
|
add_library(ctdd_logger STATIC logger.c)
|
|
target_include_directories(ctdd_logger PUBLIC "${CMAKE_SOURCE_DIR}")
|
|
target_compile_features(ctdd_logger PRIVATE c_std_23)
|
|
|
|
# Real log_write implementation — linked into production binaries only
|
|
add_library(ctdd_log_write STATIC log_write.c)
|
|
target_include_directories(ctdd_log_write PUBLIC "${CMAKE_SOURCE_DIR}")
|
|
target_compile_features(ctdd_log_write PRIVATE c_std_23)
|