CARMA C++
|
A convenience class for returning predefined log4cpp Categories. More...
#include <carma/util/Logger.h>
Public Member Functions | |
virtual | ~Logger () |
The destructor for Logger. More... | |
Static Public Member Functions | |
static log4cpp::Category & | getFilelogger (const std::string &identity, const std::string &pathname, const std::string &logname="carma.default", bool append=true, mode_t mode=00644, log4cpp::Priority::PriorityLevel priority=log4cpp::Priority::DEBUG, bool traceVerbose=true) |
static log4cpp::Category & | getOstreamlogger (const std::string &identity, std::ostream *stream=&std::cout, const std::string &logname="carma.default", log4cpp::Priority::PriorityLevel priority=log4cpp::Priority::DEBUG, bool traceVerbose=true) |
static log4cpp::Category & | getSyslogger (const std::string &identity, const std::string &host="localhost", const std::string &logname="carma.default", log4cpp::Priority::PriorityLevel priority=log4cpp::Priority::DEBUG, facilityType facility=DEFAULT_FACILITY) |
A convenience class for returning predefined log4cpp Categories.
This class has only static methods.
|
virtual |
The destructor for Logger.
|
static |
identity | The identity of the logger, i.e. the program name. This corresponds the ident parameter in the openlog(3) call. |
pathname | The file to open. This corresponds to pathname in open(2) . |
logname | The hierarchical namespace for this logger, e.g. "carma.monitor". The root logger will be "carma", all other loggers should be "carma.something[.somethingelse]" to make use of a) log4cpp's automatic heirarchical logging and b) for sorting in e.g. database queries. The default is "carma" but you really should change it. |
append | If the file already exists, true means to append to it, false means truncate it. The file will be opened with default flag O_CREAT | O_APPEND | O_WRONLY . |
mode | The file mode as is open(2) . The default mode is 00644 (file permission will be mode & ~umask ). |
priority | The minimum level of priority that messages must have in order to be logged. Default to Priority::DEBUG |
|
static |
identity | The identity of the logger, i.e. the program name. This corresponds the ident parameter in the openlog(3) call. |
stream | Pointer to the output stream to append to, defaults to &std::cerr |
logname | The hierarchical namespace for this logger, e.g. "carma.monitor". The root logger will be "carma", all other loggers should be "carma.something[.somethingelse]" to make use of a) log4cpp's automatic heirarchical logging and b) for sorting in e.g. database queries. The default is "carma.default" but you really should change it. |
priority | The minimum level of priority that messages must have in order to be logged. Default to Priority::DEBUG |
|
static |
identity | The identity for the attached Appender, i.e. the program name. This corresponds the ident parameter in the openlog(3) call. |
host | The host name for the syslog. If host string matches that returned by gethostname(3C) or is "localhost", then a SysLogAppender is attached as the default Appender, otherwise a RemoteSysLogAppender is used. The default value is "localhost" |
logname | The hierarchical namespace for this Category, e.g. "carma.monitor". The root logger will be "carma", all other loggers should be "carma.something[.somethingelse]" to make use of a) log4cpp's automatic heirarchical logging and b) for sorting in e.g. database queries. The default is "carma.default" but you really should change it. |
priority | The minimum level of priority that messages must have in order to be logged. Default to Priority::DEBUG |
facility | The syslog facility argument used to specify what type of program is logging the message. This lets the syslog configuration file specify that messages from different facilities will be handled differently. For CARMA we have defined the following facilities:
|
syslog(3)
man page.