6 #ifndef _INC_cLogAppender_H
7 #define _INC_cLogAppender_H
22 typedef cStringT<LOGCHAR_t>
cStringL;
23 #define LOGERR(hRes) LOGSTR(cStringL::GetErrorString(hRes))
59 typedef UINT32 LOG_FIELD_t;
82 : m_uAttrMask(uAttrMask)
83 , m_eLogLevel(eLogLevel)
94 m_uAttrMask = uAttrMask;
98 return((m_uAttrMask & uAttrMask) ?
true :
false);
109 m_eLogLevel = eLogLevel;
114 return(eLogLevel >= m_eLogLevel);
120 if (!IsLoggedLevel(eLogLevel))
122 if (uAttrMask != 0 && !IsLogAttrMask(uAttrMask))
146 return m_fLogThrottle;
204 va_start(vargs, pszFormat);
205 HRESULT hRes = addEventV(uAttrMask, eLogLevel, pszFormat, vargs);
214 va_start(vargs, pszFormat);
225 va_start(vargs, pszFormat);
233 va_start(vargs, pszFormat);
241 va_start(vargs, pszFormat);
249 va_start(vargs, pszFormat);
273 virtual HRESULT WriteString(
const wchar_t* pszMsg)
override;
280 bool RemoveAppenderThis();
#define IGNORE_WARN_INTERFACE(c)
Definition: GrayCore.h:79
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define IUNKNOWN_DISAMBIG(TYPE)
Definition: IUnknown.h:92
#define UNREFERENCED_PARAMETER(P)
< _WIN32 type thing. get rid of stupid warning.
Definition: SysTypes.h:299
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
Definition: cLogAppender.h:314
Definition: cLogAppender.h:296
Definition: cLogAppender.h:257
virtual HRESULT addEvent(cLogEvent *pEvent) override
Definition: cLogAppender.h:282
virtual HRESULT WriteString(const LOGCHAR_t *pszMsg) override
Definition: cLogAppender.h:264
Definition: cLogAppender.h:72
cLogEventParams(LOG_ATTR_MASK_t uAttrMask=LOG_ATTR_0, LOGLEV_TYPE eLogLevel=LOGLEV_TRACE)
Definition: cLogAppender.h:81
LOGLEV_TYPE get_LogLevel() const
Definition: cLogAppender.h:101
bool IsLogAttrMask(LOG_ATTR_MASK_t uAttrMask) const
Definition: cLogAppender.h:96
void put_LogLevel(LOGLEV_TYPE eLogLevel)
Definition: cLogAppender.h:106
bool IsLoggedLevel(LOGLEV_TYPE eLogLevel) const
Definition: cLogAppender.h:111
void put_LogAttrMask(LOG_ATTR_MASK_t uAttrMask)
Definition: cLogAppender.h:91
bool IsLogged(LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const
Definition: cLogAppender.h:117
LOGLEV_TYPE m_eLogLevel
Min Importance level to see. 0 = LOGLEV_ANY = not important.
Definition: cLogAppender.h:78
LOG_ATTR_MASK_t m_uAttrMask
Special attributes for the event. (regardless of level) similar to pszSubject?
Definition: cLogAppender.h:77
LOG_ATTR_MASK_t get_LogAttrMask() const
Definition: cLogAppender.h:87
Definition: cLogEvent.h:18
Definition: cLogAppender.h:168
virtual ~cLogProcessor()
Definition: cLogAppender.h:173
virtual const cLogNexus * get_ThisLogNexus() const
Definition: cLogAppender.h:176
HRESULT _cdecl addInfoF(const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:210
HRESULT _cdecl addEventF(LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel, const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:198
HRESULT _cdecl addDebugErrorF(const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:220
HRESULT _cdecl addDebugTraceF(const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:246
virtual HRESULT FlushLogs()
Definition: cLogAppender.h:188
HRESULT _cdecl addDebugWarnF(const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:230
HRESULT _cdecl addDebugInfoF(const LOGCHAR_t *pszFormat,...)
Definition: cLogAppender.h:238
virtual bool IsLogged(LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const override
Definition: cLogAppender.h:181
Definition: cLogAppender.h:129
UINT m_nQtyLogLast
Qty of messages since m_TimeLogLast.
Definition: cLogAppender.h:137
float get_LogThrottle() const
Definition: cLogAppender.h:143
TIMESYS_t m_TimeLogLast
Last time period for throttling (1 sec).
Definition: cLogAppender.h:136
float m_fLogThrottle
how fast sent to me? messages/sec
Definition: cLogAppender.h:135
Definition: cStream.h:126
Definition: cThreadLock.h:498
Definition: IUnknown.h:68
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
LOG_ATTR_TYPE_
Definition: cLogAppender.h:26
@ LOG_ATTR_CUST_MASK
Definition: cLogAppender.h:52
@ LOG_ATTR_DEBUG
Unclassified debug stuff. category.
Definition: cLogAppender.h:40
@ LOG_ATTR_ALL_MASK
Definition: cLogAppender.h:54
@ LOG_ATTR_TEMP
Real time status (don't bother to log permanently)
Definition: cLogAppender.h:45
@ LOG_ATTR_NET
from network activity. category. (watch out that this is not also sent on the network as it might cau...
Definition: cLogAppender.h:38
@ LOG_ATTR_PRINT
The equiv of a printf() to console.
Definition: cLogAppender.h:43
@ LOG_ATTR_PRINTBACK
Back up over the last LOG_ATTR_PRINT. append to the last.
Definition: cLogAppender.h:44
@ LOG_ATTR_INIT
startup/exit stuff. category.
Definition: cLogAppender.h:36
@ LOG_ATTR_INTERNAL
Do not echo this message as it may relate to my own logging internals (i.e.feedback loop)
Definition: cLogAppender.h:46
@ LOG_ATTR_0
Definition: cLogAppender.h:31
@ LOG_ATTR_ODD
This is odd/unusual behavior for client. category. Probably not a code problem but a user/security/in...
Definition: cLogAppender.h:39
@ LOG_ATTR_NOCRLF
Don't add a FILE_EOL (CR NL) to the end of this string. this is a partial message.
Definition: cLogAppender.h:47
@ LOG_ATTR_FILTERED
Filter already checked so don't check it again.
Definition: cLogAppender.h:48
@ LOG_ATTR_BASE_MASK
Definition: cLogAppender.h:53
@ LOG_ATTR_SCRIPT
from some sort of scripted code exec. category.
Definition: cLogAppender.h:37
LOGLEV_TYPE
Definition: cLogLevel.h:22
DECLARE_INTERFACE(IRandomNoise)
UINT32 LOG_ATTR_MASK_t
Definition: cLogAppender.h:56
cStringT< LOGCHAR_t > cStringL
Log string.
Definition: cException.h:20
char LOGCHAR_t
always just use UTF8 for logs, don't bother with UNICODE.
Definition: cLogLevel.h:17
UINT32 TIMESYS_t
TIMESYS_t = The normal system tick timer. milli-seconds since start of system/app ?
Definition: cTimeSys.h:27
Definition: cLogAppender.h:155
virtual bool IsLogged(LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel) const =0
virtual HRESULT addEvent(cLogEvent *pEvent)=0