log4cplus  2.1.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
log4cplus::spi::InternalLoggingEvent Class Reference

The internal representation of logging events. More...

#include <loggingevent.h>

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. More...
 
 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()) LOG4CPLUS_ATTRIBUTE_DEPRECATED
 
 InternalLoggingEvent (const log4cplus::tstring &logger, LogLevel loglevel, const log4cplus::tstring &ndc, MappedDiagnosticContextMap const &mdc, const log4cplus::tstring &message, const log4cplus::tstring &thread, const log4cplus::tstring &thread2, 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. More...
 
virtual unsigned int getType () const
 Returns the 'type' of InternalLoggingEvent. More...
 
virtual std::unique_ptr< InternalLoggingEventclone () const
 Returns a copy of this object. More...
 
const log4cplus::tstringgetLoggerName () const
 The logger of the logging event. More...
 
LogLevel getLogLevel () const
 LogLevel of logging event. More...
 
const log4cplus::tstringgetNDC () const
 The nested diagnostic context (NDC) of logging event. More...
 
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. More...
 
const log4cplus::tstringgetThread2 () const
 The alternative name of thread in which this logging event was generated. More...
 
const log4cplus::helpers::TimegetTimestamp () const
 Time stamp when the event was created. More...
 
const log4cplus::tstringgetFile () const
 The is the file where this log statement was written. More...
 
int getLine () const
 The is the line where this log statement was written. More...
 
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. More...
 
bool thread2Cached
 
bool ndcCached
 Indicates whether or not the NDC has been retrieved. More...
 
bool mdcCached
 Indicates whether or not the MDC has been retrieved. More...
 

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

◆ InternalLoggingEvent() [1/5]

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.

◆ InternalLoggingEvent() [2/5]

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() 
)

◆ InternalLoggingEvent() [3/5]

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,
const log4cplus::tstring thread2,
log4cplus::helpers::Time  time,
const log4cplus::tstring file,
int  line,
const log4cplus::tstring function = log4cplus::tstring() 
)

◆ InternalLoggingEvent() [4/5]

log4cplus::spi::InternalLoggingEvent::InternalLoggingEvent ( )

◆ InternalLoggingEvent() [5/5]

log4cplus::spi::InternalLoggingEvent::InternalLoggingEvent ( const log4cplus::spi::InternalLoggingEvent rhs)

◆ ~InternalLoggingEvent()

virtual log4cplus::spi::InternalLoggingEvent::~InternalLoggingEvent ( )
virtual

Member Function Documentation

◆ clone()

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

Returns a copy of this object.

Derived classes should override this method.

◆ gatherThreadSpecificData()

void log4cplus::spi::InternalLoggingEvent::gatherThreadSpecificData ( ) const

◆ getDefaultType()

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

◆ getFile()

const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getFile ( ) const
inline

The is the file where this log statement was written.

Definition at line 190 of file loggingevent.h.

◆ getFunction()

log4cplus::tstring const& log4cplus::spi::InternalLoggingEvent::getFunction ( ) const
inline

Definition at line 198 of file loggingevent.h.

◆ getLine()

int log4cplus::spi::InternalLoggingEvent::getLine ( ) const
inline

The is the line where this log statement was written.

Definition at line 196 of file loggingevent.h.

◆ getLoggerName()

const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getLoggerName ( ) const
inline

The logger of the logging event.

It is set by the LoggingEvent constructor.

Definition at line 125 of file loggingevent.h.

◆ getLogLevel()

LogLevel log4cplus::spi::InternalLoggingEvent::getLogLevel ( ) const
inline

LogLevel of logging event.

Definition at line 131 of file loggingevent.h.

◆ getMDC()

tstring const& log4cplus::spi::InternalLoggingEvent::getMDC ( tstring const &  key) const

◆ getMDCCopy()

MappedDiagnosticContextMap const& log4cplus::spi::InternalLoggingEvent::getMDCCopy ( ) const
inline

Definition at line 147 of file loggingevent.h.

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

◆ getMessage()

virtual const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getMessage ( ) const
virtual

The application supplied message of logging event.

◆ getNDC()

const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getNDC ( ) const
inline

The nested diagnostic context (NDC) of logging event.

Definition at line 137 of file loggingevent.h.

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

◆ getThread()

const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getThread ( ) const
inline

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

Definition at line 160 of file loggingevent.h.

References log4cplus::thread::getCurrentThreadName().

◆ getThread2()

const log4cplus::tstring& log4cplus::spi::InternalLoggingEvent::getThread2 ( ) const
inline

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

Definition at line 172 of file loggingevent.h.

References log4cplus::thread::getCurrentThreadName2().

◆ getTimestamp()

const log4cplus::helpers::Time& log4cplus::spi::InternalLoggingEvent::getTimestamp ( ) const
inline

Time stamp when the event was created.

Definition at line 184 of file loggingevent.h.

◆ getType()

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.)

◆ operator=()

log4cplus::spi::InternalLoggingEvent& log4cplus::spi::InternalLoggingEvent::operator= ( const log4cplus::spi::InternalLoggingEvent rhs)

◆ setFunction() [1/2]

void log4cplus::spi::InternalLoggingEvent::setFunction ( char const *  func)

◆ setFunction() [2/2]

void log4cplus::spi::InternalLoggingEvent::setFunction ( log4cplus::tstring const &  )

◆ setLoggingEvent()

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

◆ swap()

void log4cplus::spi::InternalLoggingEvent::swap ( InternalLoggingEvent )

Member Data Documentation

◆ file

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::file
protected

Definition at line 224 of file loggingevent.h.

◆ function

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::function
protected

Definition at line 225 of file loggingevent.h.

◆ line

int log4cplus::spi::InternalLoggingEvent::line
protected

Definition at line 226 of file loggingevent.h.

◆ ll

LogLevel log4cplus::spi::InternalLoggingEvent::ll
protected

Definition at line 218 of file loggingevent.h.

◆ loggerName

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::loggerName
protected

Definition at line 217 of file loggingevent.h.

◆ mdc

MappedDiagnosticContextMap log4cplus::spi::InternalLoggingEvent::mdc
mutableprotected

Definition at line 220 of file loggingevent.h.

◆ mdcCached

bool log4cplus::spi::InternalLoggingEvent::mdcCached
mutableprotected

Indicates whether or not the MDC has been retrieved.

Definition at line 233 of file loggingevent.h.

◆ message

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::message
protected

Definition at line 216 of file loggingevent.h.

◆ ndc

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::ndc
mutableprotected

Definition at line 219 of file loggingevent.h.

◆ ndcCached

bool log4cplus::spi::InternalLoggingEvent::ndcCached
mutableprotected

Indicates whether or not the NDC has been retrieved.

Definition at line 231 of file loggingevent.h.

◆ thread

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::thread
mutableprotected

Definition at line 221 of file loggingevent.h.

◆ thread2

log4cplus::tstring log4cplus::spi::InternalLoggingEvent::thread2
mutableprotected

Definition at line 222 of file loggingevent.h.

◆ thread2Cached

bool log4cplus::spi::InternalLoggingEvent::thread2Cached
mutableprotected

Definition at line 229 of file loggingevent.h.

◆ threadCached

bool log4cplus::spi::InternalLoggingEvent::threadCached
mutableprotected

Indicates whether or not the Threadname has been retrieved.

Definition at line 228 of file loggingevent.h.

◆ timestamp

log4cplus::helpers::Time log4cplus::spi::InternalLoggingEvent::timestamp
protected

Definition at line 223 of file loggingevent.h.


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