log4cplus  2.0.0
Public Member Functions | Static Public Member Functions | Protected Attributes
log4cplus::spi::InternalLoggingEvent Class Reference

The internal representation of logging events. More...

#include <loggingevent.h>

List of all members.

Public Member Functions

 InternalLoggingEvent (const log4cplus::tstring &logger, LogLevel loglevel, const log4cplus::tstring &message, const char *filename, int line, const char *function=nullptr)
 Instantiate a LoggingEvent from the supplied parameters.
 InternalLoggingEvent (const log4cplus::tstring &logger, LogLevel loglevel, const log4cplus::tstring &ndc, MappedDiagnosticContextMap const &mdc, const log4cplus::tstring &message, const log4cplus::tstring &thread, log4cplus::helpers::Time time, const log4cplus::tstring &file, int line, const log4cplus::tstring &function=log4cplus::tstring())
 InternalLoggingEvent ()
 InternalLoggingEvent (const log4cplus::spi::InternalLoggingEvent &rhs)
virtual ~InternalLoggingEvent ()
void setLoggingEvent (const log4cplus::tstring &logger, LogLevel ll, const log4cplus::tstring &message, const char *filename, int line, const char *function=nullptr)
void setFunction (char const *func)
void setFunction (log4cplus::tstring const &)
virtual const log4cplus::tstringgetMessage () const
 The application supplied message of logging event.
virtual unsigned int getType () const
 Returns the 'type' of InternalLoggingEvent.
virtual std::unique_ptr
< InternalLoggingEvent
clone () const
 Returns a copy of this object.
const log4cplus::tstringgetLoggerName () const
 The logger of the logging event.
LogLevel getLogLevel () const
 LogLevel of logging event.
const log4cplus::tstringgetNDC () const
 The nested diagnostic context (NDC) of logging event.
MappedDiagnosticContextMap const & getMDCCopy () const
tstring const & getMDC (tstring const &key) const
const log4cplus::tstringgetThread () const
 The name of thread in which this logging event was generated.
const log4cplus::tstringgetThread2 () const
 The alternative name of thread in which this logging event was generated.
const log4cplus::helpers::TimegetTimestamp () const
 Time stamp when the event was created.
const log4cplus::tstringgetFile () const
 The is the file where this log statement was written.
int getLine () const
 The is the line where this log statement was written.
log4cplus::tstring const & getFunction () const
void gatherThreadSpecificData () const
void swap (InternalLoggingEvent &)
log4cplus::spi::InternalLoggingEventoperator= (const log4cplus::spi::InternalLoggingEvent &rhs)

Static Public Member Functions

static unsigned int getDefaultType ()

Protected Attributes

log4cplus::tstring message
log4cplus::tstring loggerName
LogLevel ll
log4cplus::tstring ndc
MappedDiagnosticContextMap mdc
log4cplus::tstring thread
log4cplus::tstring thread2
log4cplus::helpers::Time timestamp
log4cplus::tstring file
log4cplus::tstring function
int line
bool threadCached
 Indicates whether or not the Threadname has been retrieved.
bool thread2Cached
bool ndcCached
 Indicates whether or not the NDC has been retrieved.
bool mdcCached
 Indicates whether or not the MDC has been retrieved.

Detailed Description

The internal representation of logging events.

When an affirmative decision is made to log then a InternalLoggingEvent instance is created. This instance is passed around to the different log4cplus components.

This class is of concern to those wishing to extend log4cplus.

Definition at line 51 of file loggingevent.h.


Constructor & Destructor Documentation

log4cplus::spi::InternalLoggingEvent::InternalLoggingEvent ( const log4cplus::tstring logger,
LogLevel  loglevel,
const log4cplus::tstring message,
const char *  filename,
int  line,
const char *  function = nullptr 
)

Instantiate a LoggingEvent from the supplied parameters.

Parameters:
loggerThe logger of this event.
loglevelThe LogLevel of this event.
messageThe message of this event.
filenameName of file where this event has occurred, can be NULL.
lineLine number in file specified by the filename parameter.
functionName of function that is logging this event.
log4cplus::spi::InternalLoggingEvent::InternalLoggingEvent ( const log4cplus::tstring logger,
LogLevel  loglevel,
const log4cplus::tstring ndc,
MappedDiagnosticContextMap const &  mdc,
const log4cplus::tstring message,
const log4cplus::tstring thread,
log4cplus::helpers::Time  time,
const log4cplus::tstring file,
int  line,
const log4cplus::tstring function = log4cplus::tstring() 
)

Member Function Documentation

virtual std::unique_ptr<InternalLoggingEvent> log4cplus::spi::InternalLoggingEvent::clone ( ) const [virtual]

Returns a copy of this object.

Derived classes should override this method.

static unsigned int log4cplus::spi::InternalLoggingEvent::getDefaultType ( ) [static]

The is the file where this log statement was written.

Definition at line 180 of file loggingevent.h.

Definition at line 188 of file loggingevent.h.

The is the line where this log statement was written.

Definition at line 186 of file loggingevent.h.

The logger of the logging event.

It is set by the LoggingEvent constructor.

Definition at line 115 of file loggingevent.h.

LogLevel of logging event.

Definition at line 121 of file loggingevent.h.

Definition at line 137 of file loggingevent.h.

References log4cplus::MDC::getContext(), and log4cplus::getMDC().

The application supplied message of logging event.

The nested diagnostic context (NDC) of logging event.

Definition at line 127 of file loggingevent.h.

References log4cplus::NDC::get(), and log4cplus::getNDC().

The name of thread in which this logging event was generated.

Definition at line 150 of file loggingevent.h.

References log4cplus::thread::getCurrentThreadName().

The alternative name of thread in which this logging event was generated.

Definition at line 162 of file loggingevent.h.

References log4cplus::thread::getCurrentThreadName2().

Time stamp when the event was created.

Definition at line 174 of file loggingevent.h.

virtual unsigned int log4cplus::spi::InternalLoggingEvent::getType ( ) const [virtual]

Returns the 'type' of InternalLoggingEvent.

Derived classes should override this method. (NOTE: Values <= 1000 are reserved for log4cplus and should not be used.)

log4cplus::spi::InternalLoggingEvent& log4cplus::spi::InternalLoggingEvent::operator= ( const log4cplus::spi::InternalLoggingEvent rhs)
void log4cplus::spi::InternalLoggingEvent::setLoggingEvent ( const log4cplus::tstring logger,
LogLevel  ll,
const log4cplus::tstring message,
const char *  filename,
int  line,
const char *  function = nullptr 
)

Member Data Documentation

Definition at line 214 of file loggingevent.h.

Definition at line 215 of file loggingevent.h.

Definition at line 216 of file loggingevent.h.

Definition at line 208 of file loggingevent.h.

Definition at line 207 of file loggingevent.h.

Definition at line 210 of file loggingevent.h.

Indicates whether or not the MDC has been retrieved.

Definition at line 223 of file loggingevent.h.

Definition at line 206 of file loggingevent.h.

Definition at line 209 of file loggingevent.h.

Indicates whether or not the NDC has been retrieved.

Definition at line 221 of file loggingevent.h.

Definition at line 211 of file loggingevent.h.

Definition at line 212 of file loggingevent.h.

Definition at line 219 of file loggingevent.h.

Indicates whether or not the Threadname has been retrieved.

Definition at line 218 of file loggingevent.h.

Definition at line 213 of file loggingevent.h.


The documentation for this class was generated from the following file: