![]() |
Carousel
|
The LoggerFacade class is just a facade for the specified application logging engine. More...
#include <LoggerFacade.h>
Inherited by NullLogger, and TextLogger.
Public Member Functions | |
LoggerFacade (const QString &name) | |
virtual void | d (const QString &message) |
virtual void | e (const QString &message) |
virtual void | f (const QString &message) |
virtual LoggerFacade * | getLogger (const QString &name) |
virtual void | i (const QString &message) |
const QString & | name () const |
virtual void | t (const QString &message) |
virtual void | w (const QString &message) |
Static Public Member Functions | |
static LoggerFacade | createLogger (const QString &name) |
static void | installLoggerEngine (LoggerFacade *loggerEngine) |
static LoggerFacade * | loggerEngine () |
Protected Member Functions | |
LoggerFacade (LoggerFacade *engine) | |
The LoggerFacade class is just a facade for the specified application logging engine.
This class provides a well-known interface and used at least by the carousel library and its components. It is strongly recomended to create your own logger facade over some better logging engine (e.g., log4cplus).
The order in terms of verbosity, from least to most is Fatal, Error, Warning, Info, Debug, Trace. Trace should never be compiled into an application except during development. Debug logs are compiled in but should be stripped at runtime (in your logging engine). Fatal, error, warning and info logs are always kept.
There is a predefined simple logger - TextLogger which is created by the BootloaderBase during the loading sequence by default, so you can access pointer to LoggerFacade instance through the loggerEngine():
To instantiate your own logger facade to the application logging engine you have to override BootloaderBase::createLoggerEngine() method in your own bootloader, that returns pointer to the LoggerFacade.
LoggerFacade::LoggerFacade | ( | const QString & | name | ) |
Initializes a new instance of the LoggerFacade class using specified logger name.
|
protected |
Initializes a new instance of the LoggerFacade class using specified logger engine and empty name.
|
static |
Creates a logger using installed logger engine.
You should use it every time when you want to get a logger:
|
static |
Gets an installed logger engine.
Usually you do not use it. Use LoggerFacade::createLogger() instead.
|
static |
Installs a logger engine which will be used at least by carousel libraries and its components.
Logger engine is installed by the BootloaderBase during the loading sequence. By default TextLogger is installed, but it is strongly recomended to use some robust logging engine (e.g. log4cplus). To do it you should override BootloaderBase::createLoggerEngine() method in your own bootloader and return pointer to the new logging engine facade.
|
virtual |
Retrieves a logger with name name.
Depends on installed logging engine it can return named logger if it already exists, or create a new instance, otherwise.
Default implementation just returns already created instance regardless of the name.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends a debug log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends an error log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends a fatal log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends an info log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends a trace log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
|
virtual |
Sends a warning log message. Default implementation does nothing.
Reimplemented in TextLogger, and NullLogger.
const QString& LoggerFacade::name | ( | ) | const |
The name which will append in the log message to the output stream.