- Namespace Addition: Moved the Logger under the chronolog namespace.
- File Renaming: Renamed log.h and log.cpp to chrono_monitor.h and chrono_monitor.cpp.
- Class Renaming: Updated the Logger class name to match the files: chrono_monitor.
- Mutex Optimization: Removed unnecessary mutexes, retaining only the initialization mutex.
Additional Analysis and Conclusions:
Compile-Time Error Handling:
- Problem: The issue of incorrect arguments resulting in runtime errors instead of compile-time errors.
- Investigation: This behavior is not due to the use of macros. It persists even when using the spdlog library directly.
- Root Cause: spdlog relies on the fmt library (formerly cppstring) for string formatting, which performs format string checks at runtime instead of compile-time.
- Conclusion: To achieve compile-time error checks, we would need to either switch to a different library or create a custom wrapper around spdlog.
Changes Made:
- Namespace Addition: Moved the Logger under the chronolog namespace. - File Renaming: Renamed log.h and log.cpp to chrono_monitor.h and chrono_monitor.cpp. - Class Renaming: Updated the Logger class name to match the files: chrono_monitor. - Mutex Optimization: Removed unnecessary mutexes, retaining only the initialization mutex.
Additional Analysis and Conclusions:
Compile-Time Error Handling:
- Problem: The issue of incorrect arguments resulting in runtime errors instead of compile-time errors. - Investigation: This behavior is not due to the use of macros. It persists even when using the spdlog library directly. - Root Cause: spdlog relies on the fmt library (formerly cppstring) for string formatting, which performs format string checks at runtime instead of compile-time. - Conclusion: To achieve compile-time error checks, we would need to either switch to a different library or create a custom wrapper around spdlog.