Reading List

The Selfish Gene
The Psychopath Test: A Journey Through the Madness Industry
Bad Science
The Feynman Lectures on Physics
The Theory of Everything: The Origin and Fate of the Universe


ifknot's favorite books »

Sunday 9 March 2014

Simplification of logging services.

As Thoreau said: "Simplify, simplify, simplify..."

The trouble with writing something in an hour or two that works is that you then have find your subconscious mind is chewing it over all the time that you're working on something else.

So it is whilst working on message_queue I couldn't resist fiddling with the logging services:
  • the io namespace is gone
  • serializor_policy is gone
  • only the null_serializor remains renamed null_log
  • ready for asycn_log
  • logger now takes an output stream policy and is, consequently, more flexible
  • works directly with any ostream decendent
  • logger template overloads operator() 
  • logger doesn't need a stringstream any longer 
  • I've left the stamps alone, for now... 

So now the logger is easier to use and more flexible:

It is a smaller, more coherent and more pleasing piece of code:

Subsequent log streams will be much more easily implemented as can be seen from null_log:
Ok, now where was I?

No comments:

Post a Comment