tags:

views:

261

answers:

4

I'm looking to replace a homebrew "logging" library with something more powerful/portable.

I've found John Torjo's "Boost Logging library", but it seems to have been rejected as part of Boost, which is a little disconcerting. What other options are available?

+3  A: 

log4cplus and log4cpp

Iulian Şerbănoiu
Thanks. log4cpp is LGPL which I'd prefer to avoid...
Roddy
+4  A: 

i'd go with log4cxx. It is a hierarchical logger, which means that you can turn different parts of the logging on or off depending on the situation. Highly recommended.

radman
+1 Didn't know about this library. I will give it a try
Iulian Şerbănoiu
log4cxx rocks, especially if you like log4j. Unfortunately, it has a comparatively long dependency chain.
Rhys Ulerich
+7  A: 

First of: Not getting accepted by boost does not mean a library is bad, boost has such high requirements that it is very difficult to get accepted. Especially for libraries that are as widely useful as Logging the requirements are staggering. In this case I know (because I participated in the discussion) that NO existing logging library would have fulfilled the requirements.

Now John Trojo has revised his library in the meantime and resubmitted it for another review. Besides Andrey Semashev has submitted Boost.Log which has been accepted provisionally.

The other suggestions made here are also good choices, so you will probably have to evaluate which one best fits your needs.

Fabio Fracassi
But we would not want Boost to lower its requirements, in fact I wish they could add "good documentation" in them, and we know it's hard to get :)
Matthieu M.
Of course. And documentation is already part of the requirement, but I agree that it could be improved. I prefer tutorial style documentation over reference, but that might be just me.
Fabio Fracassi
+1  A: 

Another logging library have been accepted recently in boost : http://boost-log.sourceforge.net/libs/log/doc/html/index.html

That might be a good solution for you if you plan to use coming versions of Boost.

That said, it's new and fresh and VERY flexible so it might be too much for you. It's more like a system to base your logging system on.

I'll use it in my personal projects to get a taste of it and because it provide thread-safety that I dont' have in my current solution.

Klaim