Boost logo

Boost :

From: JD (jean.daniel.michaud_at_[hidden])
Date: 2007-04-05 11:06:52


Gareth Buxton wrote:
> I've finished a conversion of my library (boostification) and
> placed it in the Vault under the file name boost-logger-lpp.zip
>
> I have spent some time reading through the old posts as directed and
> found much interesting insights there. LogPlusPlus (my logger) is
> largely complete and so has not been designed or implemented based on any of
> this discussion, however I do feel it might hit some nails on the head
> although in its current state it also misses others.
>
> http://www.boost-consulting.com/vault/index.php?action=downloadfile&filename=boost-logger-lpp.zip&directory=&
>
> In the src directory there is a file called 'test.cpp' that works as a
> tutorial
> and a demo program rolled into one.
>
> I have been planning to revise the back-end of the implementation for some
> time and to that end would be grateful for any comments on how to implement
> things differently.
>

Hi Gareth,

   I take a quick look at your library.
   As a reminder, here is the boost wiki aggregating the requirements
for an eventual Boost.Logging library:
http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Logging

   0- I was not able to compile the library with bjam:
Jamfile:9: in load-jamfiles
*** argument error
* rule project ( name : location ? )
* called with: ( boost/logger : source-location ../src )
* extra argument ../src
G:\Program Files\boost_1_33_1\tools/build/v1\allyourbase.jam:1274:see
definition of rule 'project' being called
G:\Program Files\boost_1_33_1\tools\build\v1\bootstrap.jam:21: in
boost-build
G:\Program Files\boost_1_33_1\boost-build.jam:16: in module scope

   or with the makefile:
make: *** No rule to make target `log_output.o', needed by `test'. Stop.

   1- Concerning formatting, I think it is a normal phase of the library
usage and shall be done without any class construction. It shall be
defined during library initialization in the more natural way possible.
Look at the way I did for the draft I proposed. I'm not saying that it
is the absolute right way but IMO it looks easier that having to define
a deriving class.

   2- I think it lacks the scoped logging that is apparently a very
demanded feature. (requirement #2)

   3- As far as I can see, there is no lazy evaluation (req #4). This is
a very strong requirement.

   4- Sorry if I insist, even if macro is evil, but the library shall
provide macro to allow logging anywhere in the code without having to
declare, allocate or define any extern global variables.

   5- What happens if two threads log at the same time?
   ThThisi s ias a lloogg :)

Technical aspect:
- The stream_map use std::string for indexing. One of the requirement on
the library that I think anybody agree on is it shall be fast. I think
it would be a better idea to map your strings to unique references
(using a set), and avoid using string to string comparison in the map
but instead compare their references.

  As a conclusion, your library looks simple and small but still lacks
some of the key features that was discussed in the previous posts. In
particular, I really think the formatting part shall be simpler for the
user, it may seems presumptuous, but have a quick look to the "XML
output" example of the draft I proposed. I am really looking for this in
  a Boost.Logging library.
  Moreover, I think the documentation is a little sparse (but it shall
be noted that code is commented though!).

  Anyone else reviewed Gareth's work?

JD


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk