The main issue of this C++ logging library is to be thread safe. This simple library has been built relying on Boost libraries; actually Boost.Thread and Boost.iostream libraries have been used.
The library is based on the singleton pattern and supports logging levels (as log4j does). The example below shows the standard use of the logging library:

	#include "logger.hpp"
	using namespace logger;
	int main(){
	   Logger::getInstance().debug().out << "Hello" << ' ' << "World" << std::endl;
	}
The library is available for download: logger.hpp

Library details

The main purpose of the library is to guarantee the consistency of the output in a multi-threaded environment. This result is obtained by means of an internal mutex that guarantee the mutual access to the underlying stream. When the debug(), info(), error() or fatal() methods are invoked a temporary object -- which, when constructed, obtains the mutual access to the underlying stream -- is created. The lock is kept until the object destructor is invoked. This object is called Wrapper.
In the previus example, the Wrapper object is not explicitly visible because it is created (at the beginning of the line) and automatically destroyed (at the end of the line). This guarantee multiple threads outputs to not be mixed in the output stream. The Wrapper object can also managed by the user taking in mind that until the object exists, a lock in the output stream is kept active.

	#include "logger.hpp"
	using namespace logger;
	int main(){
	   Wrapper w = Logger::getInstance().debug();
	   w.out << "Hello";
	   w.out << ' ' << "World" << std::endl; 
	}
Practically, this means that recursive calls to methods that needs to acquire the lock could translates in a deadlock (if the lock is not released before). The following example depicts this situation:
	#include "logger.hpp"
	using namespace logger;
	print_log(){
	   Logger::getInstance().info().out << "LOG" << std::endl; // DEADLOCK: the lock cannot be 
								   // aquired because already owned 
							           // by the main method.
	}

	int main(){
	   Wrapper w = Logger::getInstance().debug();
	   w.out << "Hello" << std::endl;
	   print_log(); 			// The main method own the mutual access to the logger
	}