grc-iit / ChronoLog

ChronoLog: A High-Performance Storage Infrastructure for Activity and Log Workloads
https://chronolog.dev
BSD 2-Clause "Simplified" License
5 stars 4 forks source link

177 enhance logger implementation with namespace and improved error handling #182

Open EnekoGonzalez3 opened 3 days ago

EnekoGonzalez3 commented 3 days ago

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.