I am working on a performance critical multi-threaded application. I looked at rlog, Ace and Boost logging. I chose rlog because I read it was the fastest (when logging is disabled, it has the least overhead).
The problem I have is it shows the file name, line number etc. even in release mode. If you can tell me how to shut that information off, my problem might be solved. In any case what is the most efficient logger in C++ for my situation?
The C++ Standard does not specify whether writing to streams is thread-safe, but usually it's not.
We will start by implementing the logger class and create a parametrized ctor. According to the RAII concept, this ctor will initialize the file stream. The second resource, the locking object, is needed in the output function. This output function which will add a logging message can be called by different threads.
Spdlog uses a lock-free queue which is the reason why it often is blazingly fast.
Unfortunately I am not able down vote at the moment. As far as I can say never ever use crap like Apache log4cxx. It contains serious bugs.
In my opinion you should go with boost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With