Main Page | Class Hierarchy | Alphabetical List | Class List | 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 getUptime ()

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

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

Private Attributes

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

Static Private Attributes

char[][] LevelNames

Detailed Description

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

Definition at line 58 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 78 of file Hierarchy.d.

References Hierarchy::name.

bool isEnabled Level  level  )  [inline]
 

Is this logger enabed for the specified Level?

Reimplemented from Logger.

Definition at line 92 of file Hierarchy.d.

Referenced by append().

bool isBreakpoint  )  [inline]
 

Is this a breakpoint Logger?

Definition at line 103 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 115 of file Hierarchy.d.

References additive.

void trace char[]  msg  )  [inline]
 

Append a trace message

Reimplemented from Logger.

Definition at line 126 of file Hierarchy.d.

References append().

void info char[]  msg  )  [inline]
 

Append an info message

Reimplemented from Logger.

Definition at line 137 of file Hierarchy.d.

References append().

void warn char[]  msg  )  [inline]
 

Append a warning message

Reimplemented from Logger.

Definition at line 148 of file Hierarchy.d.

References append().

void error char[]  msg  )  [inline]
 

Append an error message

Reimplemented from Logger.

Definition at line 159 of file Hierarchy.d.

References append().

void fatal char[]  msg  )  [inline]
 

Append a fatal message

Reimplemented from Logger.

Definition at line 170 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 181 of file Hierarchy.d.

Level getLevel  )  [inline]
 

Return the Level this logger is set to

Reimplemented from Logger.

Definition at line 195 of file Hierarchy.d.

void setLevel Level  level  )  [inline]
 

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

Reimplemented from Logger.

Definition at line 206 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 218 of file Hierarchy.d.

References Hierarchy::updateLoggers().

void setBreakpoint bool  enabled  )  [inline]
 

Set the breakpoint status of this logger.

Definition at line 230 of file Hierarchy.d.

References breakpoint, and Hierarchy::updateLoggers().

void setAdditive bool  enabled  )  [inline]
 

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

Reimplemented from Logger.

Definition at line 242 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 255 of file Hierarchy.d.

References appender, and Appender::setNext().

void clearAppenders  )  [inline]
 

Remove all appenders from this Logger

Reimplemented from Logger.

Definition at line 268 of file Hierarchy.d.

References appender.

ulong getUptime  )  [inline]
 

Get number of milliseconds since this application started

Reimplemented from Logger.

Definition at line 280 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 291 of file Hierarchy.d.

References additive, Appender::append(), appender, Appender::getMask(), Appender::getNext(), isEnabled(), parent, 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 339 of file Hierarchy.d.

References name.

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 PropertyConfigurator::configure(), BasicConfigurator::defaultAppender(), and AdminServlet::setLoggerLevel().

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 PropertyConfigurator::configure(), main(), AdminServlet::setLoggerLevel(), ServletContext::this(), and AdminServlet::this().


Member Data Documentation

LoggerInstance next [private]
 

Definition at line 60 of file Hierarchy.d.

Referenced by Hierarchy::insertLogger().

LoggerInstance parent [private]
 

Definition at line 60 of file Hierarchy.d.

Referenced by append().

char [] name [private]
 

Definition at line 63 of file Hierarchy.d.

Referenced by Hierarchy::insertLogger(), and isCloserAncestor().

Level level [private]
 

Definition at line 64 of file Hierarchy.d.

Referenced by Hierarchy::propogate().

Appender appender [private]
 

Definition at line 65 of file Hierarchy.d.

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

Hierarchy hierarchy [private]
 

Definition at line 66 of file Hierarchy.d.

bool additive [private]
 

Definition at line 67 of file Hierarchy.d.

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

bool breakpoint [private]
 

Definition at line 67 of file Hierarchy.d.

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

char [][] LevelNames [static, inherited]
 

Initial value:

 ["TRACE " "INFO " "WARN " 
                                      "ERROR " "FATAL " "NONE "]

Definition at line 81 of file Logger.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:07 2004 for Mango by doxygen 1.3.6