#include <loggingLogger.h>
Inheritance diagram for Logging::Logger:
Public Types | |
typedef Loki::SmartPtr< Logger, Loki::RefCountedMTAdj< Loki::ObjectLevelLockable >::RefCountedMT, Loki::AllowConversion, Loki::NoCheck, Loki::DefaultSPStorage > | LoggerSmartPtr |
Logger smart pointer. | |
typedef std::list< Logger * > | LoggerList |
typedef void(* | ConfigureLoggerFunction )(const std::string &loggerName) |
Public Member Functions | |
virtual LoggerSmartPtr | getLogger (const std::string &loggerName)=0 |
int | getLocalLevel () |
int | getRemoteLevel () |
int | getLocalLevel (const std::string &loggerName) |
int | getRemoteLevel (const std::string &loggerName) |
virtual std::string | getName () const |
virtual | ~Logger () |
virtual void | addHandler (Handler::HandlerSmartPtr newHandler_p) |
virtual bool | removeHandler (const std::string &handlerName) |
virtual void | log (const LogRecord &lr) |
Overridden. Invokes the log method of registered Handler objects. | |
virtual void | log (Priority priority, const std::string &message, const std::string &file, unsigned long line, const std::string &method) |
virtual void | log (Priority priority, const std::string &message) |
virtual void | setName (const std::string &newName) |
virtual void | setLevels (Priority remotePriority, Priority localPriority, int type) |
virtual void | setLevels (const std::string &loggerName, Priority remotePriority, Priority localPriority, int type) |
void | setLevelsLoggerHandlers (Priority remotePriority, Priority localPriority, int type) |
virtual bool | exists (const std::string &loggerName) |
virtual std::list< std::string > | getLoggerNames () |
Static Public Member Functions | |
LoggerSmartPtr | getAnonymousLogger () |
void | setAnonymousLogger (LoggerSmartPtr anonyLogger) |
LoggerSmartPtr | getStaticLogger () |
void | setStaticLogger (LoggerSmartPtr anonyLogger) |
LoggerSmartPtr | getGlobalLogger () |
void | setGlobalLogger (LoggerSmartPtr globalLogger) |
void | setConfigureLoggerFunction (ConfigureLoggerFunction configureLoggerFunction) |
void | configureLogger (const std::string &loggerName) |
Protected Member Functions | |
Logger (const std::string &loggerName) | |
virtual void | acquireHandlerMutex () |
virtual void | releaseHandlerMutex () |
Private Attributes | |
std::string | loggerName_m |
std::list< Handler::HandlerSmartPtr > | handlers_m |
Static Private Attributes | |
ACE_Thread_Mutex | loggersMutex_m |
ConfigureLoggerFunction | configureLoggerFunction_m |
|
|
|
|
|
Logger smart pointer.
|
|
Destructor. |
|
Constructor.
|
|
Mmethod used to facilitate logging within a multi-threaded environment. Subclasses should override this method with code used to acquire a mutual exclusion lock. The developer is free to use any type of mutex they prefer (e.g., ACE_Thread_Mutex for example). Reimplemented in Logging::ACSLogger.
|
|
Add a log Handler to receive logging messages. By default, Loggers also send their output to their parent logger. Typically the root Logger is configured with a set of Handlers that essentially act as default handlers for all loggers.
|
|
Configure logger. |
|
Logger existance check.
|
|
Static method used to get a nameless Logger object.
|
|
Static method used to get the global Logger object.
|
|
|
|
|
|
Create a logger for a named subsystem. This method is pure abstract requiring subclasses to return an instance of their own subclass.
Implemented in Logging::ACSLogger, and Logging::GenericLogger.
|
|
Get all logger names.
|
|
Retrieves the name (usually a container/component/client/) of this Logger instance
Implements Logging::BaseLog.
|
|
|
|
|
|
Static method used to get the Logger object for logging from static methods. getStaticLogger() is used in ACS_STATIC_XXX macros
|
|
This signature of log is provided as a pure convenience to developers not wishing to deal with the file name, line number, etc.
|
|
Overridden. For some reason this signature of "log" cannot be resolved from BaseLog. As a result, it must be defined here and just delegates to BaseLog Reimplemented from Logging::BaseLog.
|
|
Overridden. Invokes the log method of registered Handler objects.
Implements Logging::BaseLog.
|
|
Method used to facilitate logging within a multi-threaded environment. Subclasses should override this method with code used to release a mutual exclusion lock. The developer is free to use any type of mutex they prefer (e.g., ACE_Thread_Mutex for example). Reimplemented in Logging::ACSLogger.
|
|
Remove a log Handler.
|
|
Static method used to set the anonymous Logger object.
|
|
Set logger configuration function. |
|
Static method used to set the global Logger object.
|
|
Set levels for local and remote logging of a child logger with given name. There levels are passed to the handlers.
|
|
Set levels for local and remote logging. There levels are passed to the handlers.
|
|
|
|
Facilitates changing the name of this logger.
|
|
Static method used to set the static Logger object.
|
|
External function that configures logger. |
|
List of handlers which will have their "log" method invoked each time a log is received. DWF-access to this should be guarded by a mutex lock. |
|
Name of this logger |
|
mutex which guards the loggers lost making this class completely thread-safe |