I\'m looking for a way to do asynchronous and thread-safe logging in my C++ project, if possible to one file. I\'m currently using cerr
and clog
for th
Have you considered using a log library.
There are several available, I discovered Pantheios recently and it really seems to be quite incredible.
It's more a front-end logger, you can customize which system is used. It can interact with ACE
or log4cxx
for example and it seems really easy to use and configure. The main advantage is that it use typesafe operators, which is always great.
If you just want a barebone logging library:
Pick any :)
I should note that it's possible to implement lock-free queues in C++ and that they are great for logging.