Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cLogNexus Class Reference

#include <cLogMgr.h>

Inheritance diagram for Gray::cLogNexus:
Gray::cLogProcessor Gray::ILogProcessor Gray::cStreamOutput Gray::cStreamBase Gray::cLogMgr GrayLib::cLogThread

Public Member Functions

 cLogNexus (LOG_ATTR_MASK_t uAttrMask=LOG_ATTR_ALL_MASK, LOGLEV_TYPE eLogLevel=LOGLEV_ANY)
 
virtual ~cLogNexus ()
 
virtual const cLogNexusget_ThisLogNexus () const override
 
virtual bool IsLogged (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const override
 
virtual HRESULT addEvent (cLogEvent *pEvent) override
 
virtual HRESULT FlushLogs () override
 
cLogAppenderEnumAppender (ITERATE_t i)
 
const cLogAppenderEnumAppender (ITERATE_t i) const
 
bool HasAppender (cLogAppender *pAppender, bool bDescend=false) const
 
HRESULT AddAppender (cLogAppender *pAppender)
 
bool RemoveAppender (cLogAppender *pAppender, bool bDescend=false)
 
cLogAppenderFindAppenderType (const TYPEINFO_t &rType, bool bDescend=false) const
 
bool RemoveAppenderType (const TYPEINFO_t &rType, bool bDescend=true)
 
- Public Member Functions inherited from Gray::cLogProcessor
virtual ~cLogProcessor ()
 
HRESULT addEventS (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel, cStringL sMsg, cStringL sContext="")
 
HRESULT addEventV (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel, const LOGCHAR_t *pszFormat, va_list vargs)
 
HRESULT _cdecl addEventF (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel, const LOGCHAR_t *pszFormat,...)
 
HRESULT _cdecl addInfoF (const LOGCHAR_t *pszFormat,...)
 
HRESULT _cdecl addDebugErrorF (const LOGCHAR_t *pszFormat,...)
 
HRESULT _cdecl addDebugWarnF (const LOGCHAR_t *pszFormat,...)
 
HRESULT _cdecl addDebugInfoF (const LOGCHAR_t *pszFormat,...)
 
HRESULT _cdecl addDebugTraceF (const LOGCHAR_t *pszFormat,...)
 
- Public Member Functions inherited from Gray::cStreamOutput
 cStreamOutput () noexcept
 
virtual ~cStreamOutput ()
 
virtual HRESULT WriteX (const void *pData, size_t nDataSize)
 
HRESULT WriteT (const void *pVal, size_t nDataSize)
 
template<typename TYPE >
HRESULT WriteT (TYPE val)
 
HRESULT WriteSize (size_t nSize)
 
HRESULT WriteHashCode (HASHCODE_t nHashCode)
 
HRESULT WriteN (const void *pBuffer, size_t nSize)
 
template<typename _CH >
HRESULT WriteStringN (const _CH *pszStr)
 
template<typename _CH >
HRESULT WriteCharRepeat (_CH nChar, int nCount=1)
 
virtual HRESULT WriteString (const char *pszStr)
 
virtual HRESULT WriteString (const wchar_t *pszStr)
 
StrLen_t VPrintf (const char *pszFormat, va_list args)
 
StrLen_t VPrintf (const wchar_t *pszFormat, va_list args)
 
StrLen_t _cdecl Printf (const char *pszFormat,...)
 
StrLen_t _cdecl Printf (const wchar_t *pszFormat,...)
 
HRESULT WriteStream (cStreamInput &sInp, STREAM_POS_t nSizeMax=k_FILE_BLOCK_SIZE, IStreamProgressCallback *pProgress=nullptr, TIMESYSD_t nTimeout=0)
 Copy cStreamInput to this stream. More...
 
virtual HRESULT FlushX ()
 
- Public Member Functions inherited from Gray::cStreamBase
virtual ~cStreamBase ()
 
virtual STREAM_SEEKRET_t Seek (STREAM_OFFSET_t iOffset, SEEK_ORIGIN_TYPE eSeekOrigin=SEEK_Set)
 
void SeekToBegin ()
 
STREAM_POS_t SeekToEnd ()
 
virtual STREAM_POS_t GetPosition () const
 
virtual STREAM_POS_t GetLength () const
 

Public Attributes

cLogEventParams m_LogFilter
 Union filter what goes out to ALL appenders. More...
 
cLogThrottle m_LogThrottle
 Measure how fast messages are going. More...
 
cThreadLockCount m_LockLog
 serialize multiple threads for m_aAppenders More...
 

Protected Attributes

cArrayIUnk< cLogAppenderm_aAppenders
 where do the log messages go? child appenders. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Gray::cStreamBase
static const BYTE k_SIZE_MASK = 0x80
 Used for WriteSize() More...
 
static const size_t k_FILE_BLOCK_SIZE = (32 * 1024)
 default arbitrary transfer block size. more than this is NOT more efficient. More...
 

Detailed Description

A nexus for routing log messages. (may have sub appenders) Like Log4J Actual cLogEvent may be routed or filtered to multiple destinations/Appenders from here. Array of attached appenders to say where the logged events go. addEvent() is multi thread safe.

Constructor & Destructor Documentation

◆ cLogNexus()

Gray::cLogNexus::cLogNexus ( LOG_ATTR_MASK_t  uAttrMask = LOG_ATTR_ALL_MASK,
LOGLEV_TYPE  eLogLevel = LOGLEV_ANY 
)

◆ ~cLogNexus()

Gray::cLogNexus::~cLogNexus ( )
virtual

Member Function Documentation

◆ AddAppender()

HRESULT Gray::cLogNexus::AddAppender ( cLogAppender pAppender)

Newest first.

◆ addEvent()

HRESULT Gray::cLogNexus::addEvent ( cLogEvent pEvent)
overridevirtual

add a new log event and send it to all applicable Appenders.

Returns
<0 = failed, 0=not processed by anyone, # = number of processors.

LOG_ATTR_FILTERED

Implements Gray::ILogProcessor.

Reimplemented in GrayLib::cLogThread.

◆ EnumAppender() [1/2]

cLogAppender* Gray::cLogNexus::EnumAppender ( ITERATE_t  i)
inline

◆ EnumAppender() [2/2]

const cLogAppender* Gray::cLogNexus::EnumAppender ( ITERATE_t  i) const
inline

◆ FindAppenderType()

cLogAppender * Gray::cLogNexus::FindAppenderType ( const TYPEINFO_t rType,
bool  bDescend = false 
) const

is there an appender of this type already installed?

◆ FlushLogs()

HRESULT Gray::cLogNexus::FlushLogs ( )
overridevirtual

Reimplemented from Gray::cLogProcessor.

Reimplemented in GrayLib::cLogThread.

◆ get_ThisLogNexus()

virtual const cLogNexus* Gray::cLogNexus::get_ThisLogNexus ( ) const
inlineoverridevirtual

Is this a log nexus or just a processor?

Reimplemented from Gray::cLogProcessor.

◆ HasAppender()

bool Gray::cLogNexus::HasAppender ( cLogAppender pAppender,
bool  bDescend = false 
) const

Does this cLogNexus contain this cLogAppender ? will descend into child cLogNexus as well.

  • pAppenderFind = what are we trying to find?

◆ IsLogged()

virtual bool Gray::cLogNexus::IsLogged ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel 
) const
inlineoverridevirtual
Note
Check IsLogged(x) before generating the message! for speed

Reimplemented from Gray::cLogProcessor.

◆ RemoveAppender()

bool Gray::cLogNexus::RemoveAppender ( cLogAppender pAppender,
bool  bDescend = false 
)

will descend into child cLogNexus as well.

◆ RemoveAppenderType()

bool Gray::cLogNexus::RemoveAppenderType ( const TYPEINFO_t rType,
bool  bDescend = true 
)
inline

Member Data Documentation

◆ m_aAppenders

cArrayIUnk<cLogAppender> Gray::cLogNexus::m_aAppenders
protected

where do the log messages go? child appenders.

◆ m_LockLog

cThreadLockCount Gray::cLogNexus::m_LockLog
mutable

serialize multiple threads for m_aAppenders

◆ m_LogFilter

cLogEventParams Gray::cLogNexus::m_LogFilter

Union filter what goes out to ALL appenders.

◆ m_LogThrottle

cLogThrottle Gray::cLogNexus::m_LogThrottle

Measure how fast messages are going.


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