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

Event Class Reference

Inheritance diagram for Event:

ILevel List of all members.

Public Member Functions

void set (Hierarchy hierarchy, Level level, char[] msg, char[] name)
override char[] toString ()
char[] getName ()
char[] getContent ()
Level getLevel ()
char[] getLevelName ()
Hierarchy getHierarchy ()
long getTime ()
ulong getEpochTime ()
Event append (char[] x)

Static Public Member Functions

static this ()
static ulong getRuntime ()

Public Attributes

package Scratch scratch

Static Public Attributes

static package char[][] LevelNames

Private Types

enum  Level {
  Trace = 0, Info, Warn, Error,
  Fatal, None
}

Private Attributes

char[] msg
char[] name
ulong time
Level level
Hierarchy hierarchy

Static Private Attributes

static ulong epochTime
static ulong beginTime

Classes

struct  Scratch
class  VersionEventReset
class  VersionUseEventFreeList
class  VersionWin32

Detailed Description

Contains all information about a logging event, and is passed around between methods once it has been determined that the invoking logger is enabled for output.

Note that Event instances are maintained in a freelist rather than being allocated each time, and they include a scratchpad area for Layout formatters to use.

Definition at line 83 of file Event.d.


Member Enumeration Documentation

enum Level [inherited]
 

These represent the standard LOG4J event levels. Note that Debug is called Trace here, because debug is a reserved word in D (this needs to be fixed!).

Enumeration values:
Trace 
Info 
Warn 
Error 
Fatal 
None 

Definition at line 55 of file ILevel.d.


Member Function Documentation

static this  )  [inline, static]
 

Setup the timing information for later use. Note how much effort it takes to get epoch time in Win32 ...

Definition at line 171 of file Event.d.

References Exception, and version.

static ulong getRuntime  )  [inline, static]
 

Return the number of milliseconds since the executable was started.

Definition at line 230 of file Event.d.

References version.

void set Hierarchy  hierarchy,
Level  level,
char[]  msg,
char[]  name
[inline]
 

Set the various attributes of this event.

Definition at line 255 of file Event.d.

References hierarchy, and Hierarchy::name.

Referenced by LoggerInstance::append().

override char [] toString  )  [inline]
 

Return the message attached to this event.

Definition at line 287 of file Event.d.

Referenced by Layout::content().

char [] getName  )  [inline]
 

Return the name of the logger which produced this event

Definition at line 298 of file Event.d.

Referenced by XmlLayout::header(), SimpleTimerLayout::header(), SimpleLayout::header(), and DateLayout::header().

char [] getContent  )  [inline]
 

Return the scratch buffer for formatting. This is a thread safe place to format data within, without allocating any memory.

Definition at line 311 of file Event.d.

Referenced by XmlLayout::footer(), XmlLayout::header(), SimpleTimerLayout::header(), and SimpleLayout::header().

Level getLevel  )  [inline]
 

Return the logger level of this event.

Definition at line 322 of file Event.d.

char [] getLevelName  )  [inline]
 

Return the logger level name of this event.

Definition at line 333 of file Event.d.

Referenced by XmlLayout::header(), SimpleTimerLayout::header(), SimpleLayout::header(), and DateLayout::header().

Hierarchy getHierarchy  )  [inline]
 

Return the hierarchy where the event was produced from

Definition at line 344 of file Event.d.

Referenced by XmlLayout::footer().

long getTime  )  [inline]
 

Return the time this event was produced, relative to the start of this executable

Definition at line 356 of file Event.d.

Referenced by SimpleTimerLayout::header(), and DateLayout::header().

ulong getEpochTime  )  [inline]
 

Return the time this event was produced, relative to Jan 1st 1970

Definition at line 368 of file Event.d.

Referenced by XmlLayout::header(), and DateLayout::header().

Event append char[]  x  )  [inline]
 

Append some content to the scratch buffer. This is limited to the size of said buffer, and will not expand further.

Definition at line 380 of file Event.d.

References x.

Referenced by XmlLayout::footer(), XmlLayout::header(), SimpleTimerLayout::header(), and SimpleLayout::header().


Member Data Documentation

char [] msg [private]
 

Definition at line 86 of file Event.d.

char [] name [private]
 

Definition at line 86 of file Event.d.

ulong time [private]
 

Definition at line 88 of file Event.d.

Level level [private]
 

Definition at line 89 of file Event.d.

Hierarchy hierarchy [private]
 

Definition at line 90 of file Event.d.

Referenced by set().

ulong epochTime [static, private]
 

Definition at line 93 of file Event.d.

ulong beginTime [static, private]
 

Definition at line 94 of file Event.d.

package Scratch scratch
 

Definition at line 102 of file Event.d.

Referenced by LoggerInstance::append(), XmlLayout::footer(), and DateLayout::header().

package char [][] LevelNames [static]
 

Initial value:

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

Definition at line 106 of file Event.d.


The documentation for this class was generated from the following file:
Generated on Fri Nov 11 18:44:33 2005 for Mango by  doxygen 1.4.0