Public Member Functions | |
bool | isExcessive () |
void | excessive (bool onOff_r) |
void | setLineWriter (const shared_ptr< LogControl::LineWriter > &writer_r) |
NULL _lineWriter indicates no loggin. | |
shared_ptr < LogControl::LineWriter > | getLineWriter () const |
void | setLineFormater (const shared_ptr< LogControl::LineFormater > &format_r) |
Assert _lineFormater is not NULL. | |
void | logfile (const Pathname &logfile_r, mode_t mode_r=0640) |
std::ostream & | getStream (const std::string &group_r, LogLevel level_r, const char *file_r, const char *func_r, const int line_r) |
Provide the log stream to write (logger interface). | |
void | putStream (const std::string &group_r, LogLevel level_r, const char *file_r, const char *func_r, int line_r, const std::string &message_r) |
Format and write out a logline from Loglinebuf. | |
Static Public Member Functions | |
static LogControlImpl & | instance () |
The LogControlImpl singleton. | |
Private Types | |
typedef shared_ptr< Loglinestream > | StreamPtr |
typedef std::map< LogLevel, StreamPtr > | StreamSet |
typedef std::map< std::string, StreamSet > | StreamTable |
Private Member Functions | |
LogControlImpl () | |
Singleton ctor. | |
~LogControlImpl () | |
Private Attributes | |
std::ostream | _no_stream |
bool | _excessive |
shared_ptr < LogControl::LineFormater > | _lineFormater |
shared_ptr < LogControl::LineWriter > | _lineWriter |
StreamTable | _streamtable |
one streambuffer per group and level | |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const LogControlImpl &obj) |
_lineFormater
must not be NULL (create default LogControl::LineFormater) _lineWriter
is NULL if no logging is performed, this way we can pass _no_stream as logstream to the application, and avoid unnecessary formating of logliles, which would then be discarded when passed to some dummy LineWriter. Definition at line 222 of file LogControl.cc.
typedef shared_ptr<Loglinestream> zypp::base::logger::LogControlImpl::StreamPtr [private] |
Definition at line 299 of file LogControl.cc.
typedef std::map<LogLevel,StreamPtr> zypp::base::logger::LogControlImpl::StreamSet [private] |
Definition at line 300 of file LogControl.cc.
typedef std::map<std::string,StreamSet> zypp::base::logger::LogControlImpl::StreamTable [private] |
Definition at line 301 of file LogControl.cc.
zypp::base::logger::LogControlImpl::LogControlImpl | ( | ) | [inline, private] |
Singleton ctor.
No logging per default, unless enabled via $ZYPP_LOGFILE.
Definition at line 309 of file LogControl.cc.
References zypp::base::LogControl::logfile(), and zypp::base::LogControl::setLineFormater().
zypp::base::logger::LogControlImpl::~LogControlImpl | ( | ) | [inline, private] |
Definition at line 324 of file LogControl.cc.
bool zypp::base::logger::LogControlImpl::isExcessive | ( | ) | [inline] |
void zypp::base::logger::LogControlImpl::excessive | ( | bool | onOff_r | ) | [inline] |
Definition at line 228 of file LogControl.cc.
void zypp::base::logger::LogControlImpl::setLineWriter | ( | const shared_ptr< LogControl::LineWriter > & | writer_r | ) | [inline] |
shared_ptr<LogControl::LineWriter> zypp::base::logger::LogControlImpl::getLineWriter | ( | ) | const [inline] |
Definition at line 235 of file LogControl.cc.
void zypp::base::logger::LogControlImpl::setLineFormater | ( | const shared_ptr< LogControl::LineFormater > & | format_r | ) | [inline] |
void zypp::base::logger::LogControlImpl::logfile | ( | const Pathname & | logfile_r, | |
mode_t | mode_r = 0640 | |||
) | [inline] |
std::ostream& zypp::base::logger::LogControlImpl::getStream | ( | const std::string & | group_r, | |
LogLevel | level_r, | |||
const char * | file_r, | |||
const char * | func_r, | |||
const int | line_r | |||
) | [inline] |
Provide the log stream to write (logger interface).
Definition at line 266 of file LogControl.cc.
References zypp::base::logger::E_XXX.
Referenced by zypp::base::logger::getStream().
void zypp::base::logger::LogControlImpl::putStream | ( | const std::string & | group_r, | |
LogLevel | level_r, | |||
const char * | file_r, | |||
const char * | func_r, | |||
int | line_r, | |||
const std::string & | message_r | |||
) | [inline] |
Format and write out a logline from Loglinebuf.
Definition at line 285 of file LogControl.cc.
Referenced by zypp::base::logger::putStream().
LogControlImpl & zypp::base::logger::LogControlImpl::instance | ( | ) | [inline, static] |
The LogControlImpl singleton.
Definition at line 341 of file LogControl.cc.
Referenced by zypp::base::logger::getStream(), zypp::base::logger::isExcessive(), and zypp::base::logger::putStream().
std::ostream & operator<< | ( | std::ostream & | str, | |
const LogControlImpl & | obj | |||
) | [related] |
Stream output
Definition at line 350 of file LogControl.cc.
std::ostream zypp::base::logger::LogControlImpl::_no_stream [private] |
Definition at line 258 of file LogControl.cc.
bool zypp::base::logger::LogControlImpl::_excessive [private] |
Definition at line 259 of file LogControl.cc.
shared_ptr<LogControl::LineFormater> zypp::base::logger::LogControlImpl::_lineFormater [private] |
Definition at line 261 of file LogControl.cc.
shared_ptr<LogControl::LineWriter> zypp::base::logger::LogControlImpl::_lineWriter [private] |
Definition at line 262 of file LogControl.cc.