libcamgm
|
#include <LogControl.hpp>
Classes | |
struct | LineFormater |
struct | ShortLineFormater |
Public Types | |
typedef log::LineWriter | LineWriter |
Public Member Functions | |
void | setLineFormater (const shared_ptr< LineFormater > &formater_r) |
void | setShortLineFormater () |
void | logfile (const path::PathName &logfile_r) |
void | logfile (const path::PathName &logfile_r, mode_t mode_r) |
void | logNothing () |
void | logToStdErr () |
bool | isEnabledFor (logger::LogLevel level_r) |
void | setLogLevel (logger::LogLevel level_r) |
shared_ptr< LineWriter > | getLineWriter () const |
void | setLineWriter (const shared_ptr< LineWriter > &writer_r) |
Static Public Member Functions | |
static LogControl | instance () |
Private Member Functions | |
LogControl () | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const LogControl &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const LogControl &obj) |
Maintain logfile related options.
|
inlineprivate |
Default ctor: Singleton
Referenced by instance().
shared_ptr<LineWriter> ca_mgm::LogControl::getLineWriter | ( | ) | const |
Get the current LineWriter
|
inlinestatic |
Singleton access.
References LogControl().
bool ca_mgm::LogControl::isEnabledFor | ( | logger::LogLevel | level_r | ) |
return true is the level_r would be logged
void ca_mgm::LogControl::logfile | ( | const path::PathName & | logfile_r | ) |
Set path for the logfile. Permission for logfiles is set to 0640 unless an explicit mode_t value is given. An empty pathname turns off logging. "-"
logs to std::err.
if | logfile_r is not usable. |
void ca_mgm::LogControl::logfile | ( | const path::PathName & | logfile_r, |
mode_t | mode_r | ||
) |
void ca_mgm::LogControl::logNothing | ( | ) |
Turn off logging.
void ca_mgm::LogControl::logToStdErr | ( | ) |
Log to std::err.
void ca_mgm::LogControl::setLineFormater | ( | const shared_ptr< LineFormater > & | formater_r | ) |
Assign a LineFormater. If you want to format loglines by yourself. NULL installs the default formater.
void ca_mgm::LogControl::setLineWriter | ( | const shared_ptr< LineWriter > & | writer_r | ) |
Assign a LineWriter. If you want to log the (formated) loglines by yourself. NULL turns off logging (same as logNothing)
void ca_mgm::LogControl::setLogLevel | ( | logger::LogLevel | level_r | ) |
set the new maximal log level
void ca_mgm::LogControl::setShortLineFormater | ( | ) |
|
friend |
|
related |
Stream output