Overview
Change thread_system from an optional to a required dependency in logger_system, removing standalone mode entirely.
Background
Currently, logger_system has an optional dependency on thread_system and supports standalone mode. This causes:
- Maintenance burden for two code paths
- Complexity from conditional compilation (
#ifdef)
- Scattered test coverage
Since most higher-tier systems in unified_system already use thread_system, making it required has minimal practical impact.
Task List
Phase 1: CMake Cleanup (~1 hour)
Phase 2: Remove Conditional Compilation (~1 hour)
Macros to remove:
LOGGER_STANDALONE
LOGGER_STANDALONE_MODE
USE_THREAD_SYSTEM (make always ON)
Header files to modify (8 files):
Phase 3: std::thread → worker_thread Migration (~2-3 hours)
Approach: Use dedicated worker_thread (long-running loops)
// Before
std::thread worker_thread_;
worker_thread_ = std::thread(&impl::process_loop, this);
// After
kcenon::thread::worker_thread worker_;
worker_.start([this]{ process_loop(); });
Source files to modify (3 files):
Phase 4: Test Updates (~30 min)
Phase 5: Build Script Cleanup (~30 min)
Phase 6: Verification (~1 hour)
Affected Files (19 total)
| Category |
Count |
| CMake |
5 |
| Source |
3 |
| Headers |
8 |
| Tests |
2 |
| Scripts |
1 |
Dependency Change
Before:
logger_system
├─ common_system (REQUIRED)
└─ thread_system (OPTIONAL)
After:
logger_system
├─ common_system (REQUIRED)
└─ thread_system (REQUIRED)
Expected Benefits
- Reduced code complexity (~90% fewer conditional branches)
- Single code path for easier maintenance
- Simplified test coverage
- Access to thread_system optimizations (Lock-free Queue, Hazard Pointers, etc.)
Breaking Changes
- Standalone mode build no longer supported
logger_system cannot be used without thread_system
Estimated Time
Approximately 5-6 hours
Overview
Change
thread_systemfrom an optional to a required dependency inlogger_system, removing standalone mode entirely.Background
Currently,
logger_systemhas an optional dependency onthread_systemand supports standalone mode. This causes:#ifdef)Since most higher-tier systems in
unified_systemalready usethread_system, making it required has minimal practical impact.Task List
Phase 1: CMake Cleanup (~1 hour)
CMakeLists.txt: RemoveLOGGER_STANDALONE_MODEoptionCMakeLists.txt: Makethread_systemrequired (FATAL_ERRORif not found)cmake/LoggerDependencies.cmake: Remove fallback logiccmake/LoggerSystemConfig.cmake.in: Change tofind_package(ThreadSystem REQUIRED)tests/CMakeLists.txt: Remove standalone conditionsPhase 2: Remove Conditional Compilation (~1 hour)
Macros to remove:
LOGGER_STANDALONELOGGER_STANDALONE_MODEUSE_THREAD_SYSTEM(make always ON)Header files to modify (8 files):
include/kcenon/logger/core/thread_integration_detector.hinclude/kcenon/logger/backends/thread_system_backend.hinclude/kcenon/logger/writers/async_writer.hsrc/impl/di/di_container_factory.hsrc/impl/monitoring/monitoring_factory.hsrc/impl/monitoring/thread_system_monitor_adapter.hsrc/impl/di/thread_system_di_adapter.hsrc/impl/async/batch_processor.hPhase 3: std::thread → worker_thread Migration (~2-3 hours)
Approach: Use dedicated worker_thread (long-running loops)
Source files to modify (3 files):
src/core/log_collector.cpp(lines 111, 247)src/impl/writers/network_writer.cpp(lines 57, 61)src/impl/async/batch_processor.cpp(line 48)Phase 4: Test Updates (~30 min)
tests/integration/thread_system_integration_test.cpp: RemoveGTEST_SKIPblocksPhase 5: Build Script Cleanup (~30 min)
scripts/build.sh: Remove--standaloneoptionPhase 6: Verification (~1 hour)
Affected Files (19 total)
Dependency Change
Expected Benefits
Breaking Changes
logger_systemcannot be used withoutthread_systemEstimated Time
Approximately 5-6 hours