 |
log4cplus
2.0.5
|
Go to the documentation of this file.
25 #ifndef LOG4CPLUS_LOGGERHEADER_
26 #define LOG4CPLUS_LOGGERHEADER_
30 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
48 class HierarchyLocker;
49 class DefaultLoggerFactory;
285 spi::LoggerImpl * value =
nullptr;
325 #endif // LOG4CPLUS_LOGGERHEADER_
virtual SharedAppenderPtr getAppender(const log4cplus::tstring &name)
Get an appender by name.
void forcedLog(LogLevel ll, const log4cplus::tstring &message, const char *file=LOG4CPLUS_CALLER_FILE(), int line=LOG4CPLUS_CALLER_LINE(), const char *function=LOG4CPLUS_CALLER_FUNCTION()) const
This method creates a new logging event and logs the event without further checks.
log4cplus::tstring const & getName() const
Return the logger name.
virtual spi::LoggerImpl * makeNewLoggerImplInstance(const log4cplus::tstring &name, Hierarchy &h)
void forcedLog(spi::InternalLoggingEvent const &) const
bool getAdditivity() const
Get the additivity flag for this Logger instance.
void setAdditivity(bool additive)
Set the additivity flag for this Logger instance.
std::basic_string< tchar > tstring
Hierarchy & getHierarchy() const
Return the the Hierarchy where this Logger instance is attached.
virtual void addAppender(SharedAppenderPtr newAppender)
Add an appender.
This is the central class in the log4cplus package.
bool isEnabledFor(LogLevel ll) const
Check whether this logger is enabled for a given LogLevel passed as parameter.
static Logger getRoot()
Return the root of the default logger hierrachy.
This is used to lock a Hierarchy.
void assertion(bool assertionVal, const log4cplus::tstring &msg) const
If assertionVal parameter is false, then logs msg with FATAL_LOG_LEVEL log level.
void closeNestedAppenders() const
Close all attached appenders implementing the AppenderAttachable interface.
#define LOG4CPLUS_CALLER_FUNCTION()
This header defines the LogLevel type.
void setLogLevel(LogLevel ll)
Set the LogLevel of this Logger.
Logger() LOG4CPLUS_NOEXCEPT
LogLevel getChainedLogLevel() const
Starting from this logger, search the logger hierarchy for a "set" LogLevel and return it.
virtual void removeAppender(SharedAppenderPtr appender)
Remove the appender passed as parameter from the list of appenders.
static bool exists(const log4cplus::tstring &name)
Returns true if the named logger exists (in the default hierarchy).
Logger makeNewLoggerInstance(const log4cplus::tstring &name, Hierarchy &h)
Creates a new Logger object.
#define LOG4CPLUS_CALLER_LINE()
virtual void removeAllAppenders()
Remove all previously added appenders.
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
int LogLevel
Defines the minimum set of priorities recognized by the system, that is FATAL_LOG_LEVEL,...
virtual void removeAppender(const log4cplus::tstring &name)
Remove the appender with the name passed as parameter from the list of appenders.
Implement this interface to create new instances of Logger or a sub-class of Logger.
void log(spi::InternalLoggingEvent const &) const
The internal representation of logging events.
This Interface is for attaching Appenders to objects.
void callAppenders(const spi::InternalLoggingEvent &event) const
Call the appenders in the hierrachy starting at this.
#define LOG4CPLUS_CALLER_FILE()
std::vector< Logger > LoggerList
This is a list of Loggers.
virtual SharedAppenderPtrList getAllAppenders()
Get all previously added appenders as an Enumeration.
static void shutdown()
Calling this method will safely close and remove all appenders in all the loggers including root cont...
LogLevel getLogLevel() const
Returns the assigned LogLevel, if any, for this Logger.
static Logger getInstance(const log4cplus::tstring &name, spi::LoggerFactory &factory)
Like getInstance() except that the type of logger instantiated depends on the type returned by the {}...
static LoggerList getCurrentLoggers()
static Hierarchy & getDefaultHierarchy()
Return the default Hierarchy instance.
std::vector< log4cplus::SharedAppenderPtr > SharedAppenderPtrList
void log(LogLevel ll, const log4cplus::tstring &message, const char *file=LOG4CPLUS_CALLER_FILE(), int line=LOG4CPLUS_CALLER_LINE(), const char *function=LOG4CPLUS_CALLER_FUNCTION()) const
This generic form is intended to be used by wrappers.
#define LOG4CPLUS_NOEXCEPT
static Logger getInstance(const log4cplus::tstring &name)
Retrieve a logger with name name.
This class is used to create the default implementation of the Logger class.
This is the central class in the log4cplus package.