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

#include <cLogAppendFile.h>

Inheritance diagram for GrayLib::cLogAppendFile:
Gray::cLogAppender Gray::cRefBase GrayLib::cLogFileDay IUnknown Gray::cLogProcessor IUnknown Gray::cStreamOutput Gray::ILogProcessor Gray::cStreamOutput Gray::cStreamBase Gray::cStreamBase

Public Member Functions

 cLogAppendFile (const FILECHAR_t *pszFormat=_FN("log%s") _FN(MIME_EXT_log), int iLogKeepDays=0, LOG_ATTR_MASK_t uAttrMask=LOG_ATTR_ALL_MASK, LOGLEV_TYPE eLogLevel=LOGLEV_ANY)
 
virtual ~cLogAppendFile ()
 
virtual bool IsLogged (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const
 filter and add the event to the log file. More...
 
virtual HRESULT addEvent (cLogEvent *pEvent)
 
virtual HRESULT FlushLogs () override
 
 IUNKNOWN_DISAMBIG (cRefBase)
 
- Public Member Functions inherited from Gray::cLogAppender
 cLogAppender ()
 
virtual ~cLogAppender ()
 
bool RemoveAppenderThis ()
 Remove myself from the list of valid appenders. More...
 
- Public Member Functions inherited from Gray::cLogProcessor
virtual ~cLogProcessor ()
 
virtual const cLogNexusget_ThisLogNexus () const
 
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)
 
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...
 
- 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 Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 
- Public Member Functions inherited from GrayLib::cLogFileDay
 cLogFileDay (const FILECHAR_t *pszFileFormat=_FN("log%s") _FN(MIME_EXT_log), int iLogKeepDays=0)
 
virtual ~cLogFileDay ()
 
bool isLogOpen () const
 
cStringF get_LogPath () const
 
cStringF get_LogDir () const
 
HRESULT put_LogDir (cStringF sDir)
 
void CloseLog ()
 
HRESULT OpenLog ()
 
void DeleteOldLogs ()
 
virtual HRESULT WriteString (const LOGCHAR_t *pszMsg) override
 
virtual HRESULT FlushX () override
 

Public Attributes

cLogEventParams m_LogFilter
 filter what might be put in the file. More...
 
- Public Attributes inherited from GrayLib::cLogFileDay
cFile m_LogFile
 Place new logged events here. text file. More...
 
int m_iLogKeepDays
 Only keep logs for this many days. then delete file. 0 = forever. More...
 
bool m_bLockOpenClose
 Locked in the current OpenLogCheck or close state. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GrayLib::cLogFileDay
static cStringF GRAYCALL GetDefaultLogDir ()
 
- 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...
 
- Protected Member Functions inherited from Gray::cLogAppender
virtual HRESULT WriteString (const LOGCHAR_t *pszMsg) override
 
virtual HRESULT WriteString (const wchar_t *pszMsg) override
 
- Protected Member Functions inherited from GrayLib::cLogFileDay
cStringF MakeLogPath (const FILECHAR_t *pszFileBaseDir, const FILECHAR_t *pszName) const
 
HRESULT OpenLogNew (const cTimeUnits &rTu)
 
HRESULT OpenLogCheck (bool bStampLine)
 

Detailed Description

A cLogAppender for putting logged events in a file. add a new filter for the file.

Constructor & Destructor Documentation

◆ cLogAppendFile()

GrayLib::cLogAppendFile::cLogAppendFile ( const FILECHAR_t pszFormat = _FN("log%s") _FN(MIME_EXT_log),
int  iLogKeepDays = 0,
LOG_ATTR_MASK_t  uAttrMask = LOG_ATTR_ALL_MASK,
LOGLEV_TYPE  eLogLevel = LOGLEV_ANY 
)

◆ ~cLogAppendFile()

GrayLib::cLogAppendFile::~cLogAppendFile ( )
virtual

Member Function Documentation

◆ addEvent()

HRESULT GrayLib::cLogAppendFile::addEvent ( cLogEvent pEvent)
virtual

cLogAppender - write an event string out to this log file.

Returns
Length chars written.

Reimplemented from Gray::cLogAppender.

◆ FlushLogs()

virtual HRESULT GrayLib::cLogAppendFile::FlushLogs ( )
inlineoverridevirtual

Override this to flush logs for this processor.

Reimplemented from Gray::cLogProcessor.

◆ IsLogged()

virtual bool GrayLib::cLogAppendFile::IsLogged ( LOG_ATTR_MASK_t  uAttrMask,
LOGLEV_TYPE  eLogLevel 
) const
inlinevirtual

filter and add the event to the log file.

Note
Check IsLogged(x) before generating the message! for speed

Reimplemented from Gray::cLogProcessor.

◆ IUNKNOWN_DISAMBIG()

GrayLib::cLogAppendFile::IUNKNOWN_DISAMBIG ( cRefBase  )

Member Data Documentation

◆ m_LogFilter

cLogEventParams GrayLib::cLogAppendFile::m_LogFilter

filter what might be put in the file.


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