Inheritance diagram for Logger:
Public Member Functions | |
void | trace (char[] msg) |
void | info (char[] msg) |
void | warn (char[] msg) |
void | error (char[] msg) |
void | fatal (char[] msg) |
char[] | getName () |
Level | getLevel () |
void | setLevel (Level level) |
void | setLevel (Level level, bool force) |
bool | isEnabled (Level level) |
bool | isAdditive () |
void | setAdditive (bool enabled) |
void | clearAppenders () |
void | addAppender (Appender appender) |
ulong | getUptime () |
Static Public Member Functions | |
Logger | getRootLogger () |
Logger | getLogger (char[] name) |
Static Public Attributes | |
char[][] | LevelNames |
Messages passed to a Logger are assumed to be pre-formatted. You may find that the TextFormat class is handy for collating various components of the message.
You may also need to use one of the two classes BasicConfigurator and PropertyConfigurator, along with the various Layout & Appender implementations to support your exact rendering needs.
Mango.log closely follows both the API and the behaviour as documented at the official Log4J site, where you'll find a good tutorial. Those pages are hosted over here.
Definition at line 82 of file Logger.d.
|
Return the root Logger instance. This is the ancestor of all loggers and, as such, can be used to manipulate the entire hierarchy. For instance, setting the root 'level' attribute will affect all other loggers in the tree. Definition at line 96 of file Logger.d. References Manager. Referenced by BasicConfigurator::defaultAppender(). |
|
Return an instance of the named logger. Names should be hierarchical in nature, using dot notation (with '.') to seperate each name section. For example, a typical name might be something like "mango.io.Buffer". If the logger does not currently exist, it is created and inserted into the hierarchy. A parent will be attached to it, which will be either the root logger or the closest ancestor in terms of the hierarchical name space. Definition at line 115 of file Logger.d. References Manager. Referenced by AdminServlet::this(). |
|
Add a trace messages. This is called 'debug' in Log4J but that is a reserved word in the D language. This needs some more thought. Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Add an info message Reimplemented in LoggerInstance. Referenced by AdminServlet::setLoggerLevel(). |
|
Add a warning message Reimplemented in LoggerInstance. |
|
Add an error message Reimplemented in LoggerInstance. |
|
Add a fatal message Reimplemented in LoggerInstance. |
|
Return the name of this Logger Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Return the current level assigned to this logger Reimplemented in LoggerInstance. Referenced by AdminServlet::service(). |
|
Set the activity level of this logger. Levels control how much information is emitted during runtime, and relate to each other as follows: Trace < Info < Warn < Error < Fatal < None That is, if the level is set to Error, only calls to the error() and fatal() methods will actually produce output: all others will be inhibited. Note that Log4J is a hierarchical environment, and each logger defaults to inheriting a level from its parent. Reimplemented in LoggerInstance. Referenced by AdminServlet::addLogger(), BasicConfigurator::configure(), and AdminServlet::setLoggerLevel(). |
|
same as setLevel (Level), but with additional control over whether the children are forced to accept the changed level or not. If 'force' is false, then children adopt the parent level only if they have their own level set to Level.None Reimplemented in LoggerInstance. |
|
Is this logger enabled for the provided level? Reimplemented in LoggerInstance. |
|
Return whether this logger uses additive appenders or not. See setAdditive(). Reimplemented in LoggerInstance. |
|
Specify whether or not this logger has additive behaviour. This is enabled by default, and causes a logger to invoke all appenders within its ancestry (until an ancestor is found with an additive attribute of false). Reimplemented in LoggerInstance. |
|
Remove all appenders from this logger. Reimplemented in LoggerInstance. |
|
Add an appender to this logger. You may add multiple appenders to appropriate loggers, and each of them will be invoked for that given logger, and for each of its child loggers (assuming isAdditive() is true for those children). Note that multiple instances of the same appender, regardless of where they may reside within the tree, are not invoked at runtime. That is, only one from a set of identical loggers will execute. Use clearAttributes() to remove all from a given logger. Reimplemented in LoggerInstance. Referenced by BasicConfigurator::defaultAppender(). |
|
Get number of milliseconds since this application started Reimplemented in LoggerInstance. |
|
Initial value: ["TRACE " "INFO " "WARN " "ERROR " "FATAL " "NONE "] |