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