Archive for the ‘Library’ Category

C++ logger class

Monday, February 8th, 2010

I was looking for a logger implementation for one of my projects. I needed a few features: simultaneous output to a console and a log file, efficiency, and ease of use. Quick google search revealed a few candidates: Apache log4cxx, and Pantheios. Do it yourself articles (example) about home made logging I ignored, because I have done enough of those (Boost Logging Library v2 is in the same category for me). Given that my primary platform is Windows, log4cxx was dropped, as windows was not directly supported.

Compiling a few examples for pantheios was not difficult, but getting it to do exactly what I planned, which is to have output to a console and a file at the same time, was a little more challenging. The solution was not obvious from the documentation, and sample name mx.1 did not stand out to me as meaning Mixing different back ends. But after searching in pantheios forums I have found the answer to my question.

At the end of the day Pantheios was my choice. We will see how happy I will be with it after I play with it for a while.