[logging] Review of proposed logging library

I have reviewed the current logging library. Some of my functional requirements are: - different writers: stdout, file, rolling file [OK] - possibility to dynamically change log levels [OK] - logging from separate modules of the code with annotation [OK] - filtering based upon modules and levels [OK] - possibility to adjust log levels for modules separately [OK] - logging statements for non enabled levels should not be evaluated [OK] - thread safety when logging from different threads [OK] - configuration from configuration file(s) [NOT OK] - logger hierarchies with property/config propagation [NOT OK] - possibility to use printf syntax when logging [NOK OK] * What is your evaluation of the design? The logging library is very flexible and usable. It is possible to integrate the library by using different levels of detail. In it's simplest form it is very easy to use. When trying to use the more advanced parts of the library, the learning curve quickly becomes steeper (but manageable). The logging library also allows to trade off flexibility to performance. The flexibility allows the user of the library to write small pieces of code that can be used to implement application specific requirements. This is important because logging requirements will vary largely between applications. The major parts missing are logger hierarchies with support for configuration propagation and configuration of these hierarchies from config files. This is a feature supported by the C++ equivalents of log4j. The design in terms of classes and files seems fine by me. I like that the library is headers only. The use of macros will always be a discussion point, but it is convenient for a logging library. I do not have big issues with this. The separation of loggers, filters, formatters and writers appeal to me. Splitting the headers into forward declarations and definitions is very good to reduce compile time for big projects. * What is your evaluation of the implementation? I have only had a brief look at the internal implementation. Extensive use of templates and name spaces (too much?). The author seems very knowledgeable of C++ and the logging domain. * What is your evaluation of the documentation? Thorough documentation with a lot of examples and tutorials. I was able to find what I was looking for most of the time. Maybe a bit of reorganizing is needed because the front page seems a bit overwhelming at first. Formalization of some sentences and comments would be nice if the library gets accepted into boost. * What is your evaluation of the potential usefulness of the library? Very useful. A good standard logging library is needed. There are a lot of logging libraries out there, but their user bases and vitality differ greatly. Having boost::logging would make the decision of which logging library to use easier for a lot of developers. I would expect that the user base of this library would rapidly grow larger than a lot of other logging libraries. * Did you try to use the library? With what compiler? Did you have any problems? I compiled the tests on CentOS 5 x86_64 with gcc 4.1. Gcc issues some warnings about not having virtual destructors and sign mismatches. After scanning the review threads these seems to be fixed in the svn trunk. I had one test fail (testing.capture-output), but did not investigate this any further. I also did a quick spin with valgrind (3.3.0): valgrind --tool=memcheck --leak-check=full ./mul_levels_one_logger Valgrind reports a lot of conditional jumps/moves based upon uninitialized values and usage of uninitialized variables. This has to be fixed. I adapted one application to use the boost::logging. The library seems to work as advertised, but I had to write some filter code to adapt the logging to the functionality needed (module annotation with different log levels in each module). * How much effort did you put into your evaluation? I put about 6 hours into the evaluation. * Are you knowledgeable about the problem domain? I believe so. I have used different logging libraries and have written wrappers for applications. * Do you think the library should be accepted as a Boost library? Yes, but compiler and valgrind warnings has to be fixed before submission. Also all the tests must be verified to run without errors on all supported platforms. A big thanks to John for putting the effort into making a useful logging library. Regards, Arnstein

Hi Arnstein , Thanks for the review.
- configuration from configuration file(s) [NOT OK]
True, but we're pretty close ;)
- logger hierarchies with property/config propagation [NOT OK]
If you mean logger hierarchies like in v1, they're not there. I realized that they are not as useful as I thought. I will allow to copy one log into another. Do you think that's enough, or do you have a specific case where you'd like that?
- possibility to use printf syntax when logging [NOK OK]
Note - basically you can create your own gather class (which for instance can use boost::format) and implement this
* What is your evaluation of the design?
The major parts missing are logger hierarchies with support for configuration propagation and configuration of these hierarchies from config files. This is a feature supported by the C++ equivalents of log4j.
The design in terms of classes and files seems fine by me. I like that the library is headers only. The use of macros will always be a discussion point, but it is convenient for a logging library. I do not have big issues with this. The separation of loggers, filters, formatters and writers appeal to me. Splitting the headers into forward declarations and definitions is very good to reduce compile time for big projects.
Thanks :)
* What is your evaluation of the documentation? Thorough documentation with a lot of examples and tutorials. I was able to find what I was looking for most of the time. Maybe a bit of reorganizing is needed because the front page seems a bit overwhelming at first. Formalization of some sentences and comments would be nice if the library gets accepted into boost.
Yes will do - others have noticed that as well.
I also did a quick spin with valgrind (3.3.0): valgrind --tool=memcheck --leak-check=full ./mul_levels_one_logger
Valgrind reports a lot of conditional jumps/moves based upon uninitialized values and usage of uninitialized variables. This has to be fixed.
I will have to check this - once I learn how to use valgrind ;)
* Do you think the library should be accepted as a Boost library? Yes, but compiler and valgrind warnings has to be fixed before submission. Also all the tests must be verified to run without errors on all supported platforms.
A big thanks to John for putting the effort into making a useful logging library.
Thanks ;) Best, John -- http://John.Torjo.com -- C++ expert http://blog.torjo.com ... call me only if you want things done right

If you mean logger hierarchies like in v1, they're not there. I realized that they are not as useful as I thought. I will allow to copy one log into another. Do you think that's enough, or do you have a specific case where you'd like that?
I have not looked at v1 of the library, but I meant hierarchies like in log4j. You have a hierarchy of loggers where each logger has it's formatter and writer(s). Changes to the configuration somewhere in the hierarchy will propagate down to the loggers further down in the three. This an easy way of adjusting log levels etc. for a set of loggers instead of having to copy the settings to all loggers manually. It is possible to build a framework on top of the current library that will handle this so it's not a show stopper. Regards, Arnstein

On Wed, Feb 13, 2008 at 09:31:08AM +0100, Arnstein Ressem wrote:
If you mean logger hierarchies like in v1, they're not there. I realized that they are not as useful as I thought. I will allow to copy one log into another. Do you think that's enough, or do you have a specific case where you'd like that?
I have not looked at v1 of the library, but I meant hierarchies like in log4j. You have a hierarchy of loggers where each logger has it's formatter and writer(s). Changes to the configuration somewhere in the hierarchy will propagate down to the loggers further down in the three. This an easy way of adjusting log levels etc. for a set of loggers instead of having to copy the settings to all loggers manually. It is possible to build a framework on top of the current library that will handle this so it's not a show stopper.
This should be similar as used in version 1. I also like to define loggers with names "math.solver.pcg", "math.solver.multigrid", "math.solver.jacobi" and beeing able to set verbosity by accessing "math.solver*". This is a feature in version 1 I really like! Jens

This should be similar as used in version 1. I also like to define loggers with names "math.solver.pcg", "math.solver.multigrid", "math.solver.jacobi" and beeing able to set verbosity by accessing "math.solver*". This is a feature in version 1 I really like!
Got it, will see what I can do ;) Best, John
Jens _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert http://blog.torjo.com ... call me only if you want things done right
participants (3)
-
Arnstein Ressem
-
Jens Seidel
-
John Torjo