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

#include <cLogAppender.h>

Inheritance diagram for Gray::cLogProcessor:
Gray::ILogProcessor Gray::cStreamOutput Gray::cStreamBase Gray::cLogAppender Gray::cLogNexus Gray::cLogSubject Gray::cLogAppendCache Gray::cLogAppendConsole Gray::cLogAppendDebug Gray::cLogAppendTextArray GrayFTP::cFTPGUI GrayLib::cClientLogger GrayLib::cLogAppendFile GrayLib::cLogThread Gray::cLogMgr GrayLib::cLogThread

Public Member Functions

virtual ~cLogProcessor ()
 
virtual const cLogNexusget_ThisLogNexus () const
 
virtual bool IsLogged (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const override
 
virtual HRESULT FlushLogs ()
 
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::ILogProcessor
virtual HRESULT addEvent (cLogEvent *pEvent)=0
 
- 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
 

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

Build/submit a log message to be submitted to the log system.

Constructor & Destructor Documentation

◆ ~cLogProcessor()

virtual Gray::cLogProcessor::~cLogProcessor ( )
inlinevirtual

Member Function Documentation

◆ addDebugErrorF()

HRESULT _cdecl Gray::cLogProcessor::addDebugErrorF ( const LOGCHAR_t pszFormat,
  ... 
)
inline

Add message with LOG_ATTR_DEBUG

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

◆ addDebugInfoF()

HRESULT _cdecl Gray::cLogProcessor::addDebugInfoF ( const LOGCHAR_t pszFormat,
  ... 
)
inline

◆ addDebugTraceF()

HRESULT _cdecl Gray::cLogProcessor::addDebugTraceF ( const LOGCHAR_t pszFormat,
  ... 
)
inline

◆ addDebugWarnF()

HRESULT _cdecl Gray::cLogProcessor::addDebugWarnF ( const LOGCHAR_t pszFormat,
  ... 
)
inline

◆ addEventF()

HRESULT _cdecl Gray::cLogProcessor::addEventF ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel,
const LOGCHAR_t pszFormat,
  ... 
)
inline
  • uAttrMask = LOG_ATTR_DEBUG|LOG_ATTR_INTERNAL
  • eLogLevel = LOGLEV_TRACE, LOGLEV_ERROR
    Returns
    <0 = failed, 0=not processed by anyone, # = number of processors.

◆ addEventS()

HRESULT Gray::cLogProcessor::addEventS ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel,
cStringL  sMsg,
cStringL  sContext = "" 
)

Dispatch the event to all matching appenders. ASSUME new line.

Note
This can be called by multiple threads!
This could be called in odd interrupt context so don't use dynamic stuff
Returns
<0 = failed, 0=not processed by anyone, # = number of processors.

◆ addEventV()

HRESULT Gray::cLogProcessor::addEventV ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel,
const LOGCHAR_t pszFormat,
va_list  vargs 
)

Add a log message (line) to the system in the sprintf() format (with arguments) ASSUME new line.

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

◆ addInfoF()

HRESULT _cdecl Gray::cLogProcessor::addInfoF ( const LOGCHAR_t pszFormat,
  ... 
)
inline
Returns
<0 = failed, 0=not processed by anyone, # = number of processors.

◆ FlushLogs()

virtual HRESULT Gray::cLogProcessor::FlushLogs ( )
inlinevirtual

Override this to flush logs for this processor.

Reimplemented in GrayLib::cLogThread, GrayLib::cLogAppendFile, and Gray::cLogNexus.

◆ get_ThisLogNexus()

virtual const cLogNexus* Gray::cLogProcessor::get_ThisLogNexus ( ) const
inlinevirtual

Is this a cLogNexus or just a cLogProcessor? like dynamic_cast<>

Reimplemented in Gray::cLogNexus.

◆ IsLogged()

virtual bool Gray::cLogProcessor::IsLogged ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel 
) const
inlineoverridevirtual

would this message be logged? should i bother building it ? fast.

Implements Gray::ILogProcessor.

Reimplemented in Gray::cLogNexus, and GrayLib::cLogAppendFile.


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