Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

LoggerInstance Class Reference

Inheritance diagram for LoggerInstance:

Logger List of all members.

Public Member Functions

bool isEnabled (Level level)
bool isBreakpoint ()
bool isAdditive ()
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)
void setBreakpoint (bool enabled)
void setAdditive (bool enabled)
void addAppender (Appender next)
void clearAppenders ()
ulong getRuntime ()

Protected Member Functions

 this (Hierarchy hierarchy, char[] name)

Private Member Functions

final void append (Level level, char[] s)
final bool isCloserAncestor (LoggerInstance other)

Static Private Member Functions

static Logger getRootLogger ()
static Logger getLogger (char[] name)

Private Attributes

LoggerInstance next
LoggerInstance parent
char[] name
Level level
Appender appender
Hierarchy hierarchy
bool additive
bool breakpoint

Detailed Description

This is the real Logger implementation, hidden behind the public abstract frontage.

Definition at line 64 of file Hierarchy.d.


Member Function Documentation

this Hierarchy  hierarchy,
char[]  name
[inline, protected]
 

Construct a LoggerInstance with the specified name for the given hierarchy. By default, logger instances are additive and are prohibited from emitting events.

Definition at line 84 of file Hierarchy.d.

References hierarchy, Hierarchy::name, and name.

bool isEnabled Level  level  )  [inline]
 

Is this logger enabed for the specified Level?

Reimplemented from Logger.

Definition at line 98 of file Hierarchy.d.

Referenced by append().

bool isBreakpoint  )  [inline]
 

Is this a breakpoint Logger?

Definition at line 109 of file Hierarchy.d.

References breakpoint.

bool isAdditive  )  [inline]
 

Is this logger additive? That is, should we walk ancestors looking for more appenders?

Reimplemented from Logger.

Definition at line 121 of file Hierarchy.d.

References additive.

void trace char[]  msg  )  [inline]
 

Append a trace message

Reimplemented from Logger.

Definition at line 132 of file Hierarchy.d.

References append().

void info char[]  msg  )  [inline]
 

Append an info message

Reimplemented from Logger.

Definition at line 143 of file Hierarchy.d.

References append().

void warn char[]  msg  )  [inline]
 

Append a warning message

Reimplemented from Logger.

Definition at line 154 of file Hierarchy.d.

References append().

void error char[]  msg  )  [inline]
 

Append an error message

Reimplemented from Logger.

Definition at line 165 of file Hierarchy.d.

References append().

void fatal char[]  msg  )  [inline]
 

Append a fatal message

Reimplemented from Logger.

Definition at line 176 of file Hierarchy.d.

References append().

char [] getName  )  [inline]
 

Return the name of this Logger (sans the appended dot).

Reimplemented from Logger.

Definition at line 187 of file Hierarchy.d.

References name.

Level getLevel  )  [inline]
 

Return the Level this logger is set to

Reimplemented from Logger.

Definition at line 201 of file Hierarchy.d.

References level.

void setLevel Level  level  )  [inline]
 

Set the current level for this logger (and only this logger).

Reimplemented from Logger.

Definition at line 212 of file Hierarchy.d.

void setLevel Level  level,
bool  force
[inline]
 

Set the current level for this logger, and (optionally) all of its descendents.

Reimplemented from Logger.

Definition at line 224 of file Hierarchy.d.

References hierarchy, and Hierarchy::updateLoggers().

void setBreakpoint bool  enabled  )  [inline]
 

Set the breakpoint status of this logger.

Definition at line 236 of file Hierarchy.d.

References breakpoint, hierarchy, and Hierarchy::updateLoggers().

void setAdditive bool  enabled  )  [inline]
 

Set the additive status of this logger. See isAdditive().

Reimplemented from Logger.

Definition at line 248 of file Hierarchy.d.

References additive.

void addAppender Appender  next  )  [inline]
 

Add (another) appender to this logger. Appenders are each invoked for log events as they are produced. At most, one instance of each appender will be invoked.

Reimplemented from Logger.

Definition at line 261 of file Hierarchy.d.

References appender, and Appender::setNext().

void clearAppenders  )  [inline]
 

Remove all appenders from this Logger

Reimplemented from Logger.

Definition at line 274 of file Hierarchy.d.

References appender.

ulong getRuntime  )  [inline]
 

Get number of milliseconds since this application started

Reimplemented from Logger.

Definition at line 286 of file Hierarchy.d.

final void append Level  level,
char[]  s
[inline, private]
 

Append a message to this logger via its appender list.

Definition at line 297 of file Hierarchy.d.

References additive, Appender::append(), appender, Appender::getMask(), Appender::getNext(), hierarchy, isEnabled(), name, parent, Event::scratch, and Event::set().

Referenced by error(), fatal(), info(), trace(), and warn().

final bool isCloserAncestor LoggerInstance  other  )  [inline, private]
 

See if the provided Logger is a good match as a parent of this one. Note that each Logger name has a '.' appended to the end, such that name segments will not partially match.

Definition at line 346 of file Hierarchy.d.

References memcmp(), name, and parent.

Referenced by Hierarchy::propogate().

static Logger getRootLogger  )  [inline, static, inherited]
 

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 93 of file Logger.d.

Referenced by BasicConfigurator::defaultAppender(), and AdminServlet::setLoggerLevel().

static Logger getLogger char[]  name  )  [inline, static, inherited]
 

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 112 of file Logger.d.

Referenced by AdminServlet::setLoggerLevel(), and AdminServlet::this().


Member Data Documentation

LoggerInstance next [private]
 

Definition at line 66 of file Hierarchy.d.

Referenced by Hierarchy::insertLogger(), Hierarchy::opApply(), and Hierarchy::updateLoggers().

LoggerInstance parent [private]
 

Definition at line 66 of file Hierarchy.d.

Referenced by append(), isCloserAncestor(), and Hierarchy::propogate().

char [] name [private]
 

Definition at line 69 of file Hierarchy.d.

Referenced by append(), getName(), Hierarchy::insertLogger(), isCloserAncestor(), Hierarchy::setName(), Hierarchy::this(), and this().

Level level [private]
 

Definition at line 70 of file Hierarchy.d.

Referenced by getLevel(), and Hierarchy::propogate().

Appender appender [private]
 

Definition at line 71 of file Hierarchy.d.

Referenced by addAppender(), append(), and clearAppenders().

Hierarchy hierarchy [private]
 

Definition at line 72 of file Hierarchy.d.

Referenced by append(), setBreakpoint(), setLevel(), and this().

bool additive [private]
 

Definition at line 73 of file Hierarchy.d.

Referenced by append(), isAdditive(), and setAdditive().

bool breakpoint [private]
 

Definition at line 73 of file Hierarchy.d.

Referenced by isBreakpoint(), Hierarchy::propogate(), and setBreakpoint().


The documentation for this class was generated from the following file:
Generated on Sat Dec 24 17:28:40 2005 for Mango by  doxygen 1.4.0