1 #ifndef CARMA_UTIL_LOGGER_H
2 #define CARMA_UTIL_LOGGER_H
11 #include <log4cpp/Category.hh>
12 #include <log4cpp/FileAppender.hh>
13 #include <log4cpp/Layout.hh>
14 #include <log4cpp/SimpleLayout.hh>
15 #include <log4cpp/NDC.hh>
16 #include <log4cpp/Portability.hh>
17 #include <log4cpp/Priority.hh>
18 #include <log4cpp/OstreamAppender.hh>
19 #include <log4cpp/RemoteSyslogAppender.hh>
20 #include <log4cpp/SyslogAppender.hh>
21 #include <log4cpp/TimeStamp.hh>
25 #include "carma/util/FacilityType.h"
106 static log4cpp::Category&
108 const std::string& host =
"localhost",
109 const std::string& logname =
"carma.default",
110 log4cpp::Priority::PriorityLevel priority =
111 log4cpp::Priority::DEBUG,
152 static log4cpp::Category&
154 const std::string& pathname,
155 const std::string& logname =
"carma.default",
158 log4cpp::Priority::PriorityLevel priority =
159 log4cpp::Priority::DEBUG,
160 bool traceVerbose =
true );
189 static log4cpp::Category&
191 std::ostream *stream = &std::cout,
192 const std::string& logname =
"carma.default",
193 log4cpp::Priority::PriorityLevel priority =
194 log4cpp::Priority::DEBUG,
195 bool traceVerbose =
true );
235 virtual std::string
format(
const log4cpp::LoggingEvent& event);
271 virtual std::string
format(
const log4cpp::LoggingEvent& event);
304 virtual std::string
format(
const log4cpp::LoggingEvent& event);
309 #endif // CARMA_UTIL_LOGGER_H
virtual ~FileLayout()
Destructor for FileLayout.
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)
virtual ~VerySimpleLayout()
Destructor for VerySimpleLayout.
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)
Syslog layout class for CARMA logging.
File layout class for CARMA logging.
virtual std::string format(const log4cpp::LoggingEvent &event)
Formats the LoggingEvent in FileLayout style: "Time {Priority} {Category} {Nested Diagnostic Context...
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)
virtual std::string format(const log4cpp::LoggingEvent &event)
Formats the LoggingEvent in VerySimpleLayout style: "Name:NN: Message" where Name is the file name...
A convenience class for returning predefined log4cpp Categories.
FileLayout()
Default constructor for FileLayout.
Very Simple layout class for CARMA tracing.
virtual std::string format(const log4cpp::LoggingEvent &event)
Formats the LoggingEvent in SyslogLayout style: "Time Identity: {Year} {Priority} {Category} {Nested...
facilityType
A type for syslog facilities.
virtual ~Logger()
The destructor for Logger.
SyslogLayout()
Default constructor for SyslogLayout.
VerySimpleLayout()
Default constructor for VerySimpleLayout.
virtual ~SyslogLayout()
Destructor for SyslogLayout.