foolano/toppackages — pull request #5 by rmunoz (2012-09-27 17:34:28+00:00)
Title: Logging support using std::clog integrated

A new logger class was added, it uses RAII idiom to change std::clog streambuf
by a log_streambuf pointer. When logger instance goes out of scope it
destructor is called and std::clog gets his old streambuf pointer.

log_streambuf class inherits from basic_streambuf and implements streambuf
functionality through syslog calls. It wraps the use of C syslog.h
functionality into streambuf class and encapsulates facility and priority macro
values into C++11 enum classes.

An instance of logger was added at main function with logger::facility::daemon
constructor attribute. This produce that all std::clog uses goes to
/var/log/daemon.log