|
#include <CBaseLog.h>

Public Types | |
| enum | CLogOption { CLO_STDOUT = 1, CLO_DATE = 2, CLO_TIME = 4, CLO_PRIORITY = 8, CLO_ENABLE = 16 } |
| Log options. More... | |
Public Member Functions | |
| virtual void | saveMessage (CDateTime date, const char *message, uint32_t sz, const CLogPriority *priority) throw (CException) |
| Stores or sends log message to actual destination. | |
| virtual | ~CBaseLog () |
| Destructor Flushes the log and releases any allocated resources. | |
| void | options (int ops) |
| Sets log options. | |
| int | options () const |
| Returns log options. | |
| void | option (CLogOption option, bool flag) |
| Sets an option to true or false. | |
| void | priority (const CLogPriority &prt) |
| Sets current message priority. | |
| virtual void | reset () throw (CException) |
| Restarts the log, if applicable In CBaseLog it does nothing. | |
| virtual void | defaultPriority (CLogPriority &priority) |
| Sets the default priority. | |
| virtual const CLogPriority & | defaultPriority () const |
| Returns the default priority. | |
| virtual void | minPriority (const CLogPriority &prt) |
| Sets min message priority. | |
| virtual const CLogPriority & | minPriority () const |
| Returns the min priority. | |
Protected Member Functions | |
| CBaseLog () | |
| Protected constructor. | |
Protected Attributes | |
| CLogStreamBuf | m_buffer |
| Log buffer. | |
| int | m_indent |
| Text indent. | |
| const CLogPriority * | m_defaultPriority |
| The default priority for the new message. | |
| const CLogPriority * | m_minPriority |
| Min message priority, should be defined for every message. | |
| int | m_options |
| Log options, a bit combination of CLogOption. | |
Friends | |
| class | CFunctionLogger |
| class | CLogStreamBuf |
| sptk::CBaseLog::CBaseLog | ( | ) | [inline, protected] |
Protected constructor.
Creates an empty log object. You should never try to instantiate this class. CBaseLog can only be used as a base class for log classes that implement at least saveMessage() method. The default message priority is CLP_NOTICE.
References CLO_DATE, CLO_ENABLE, CLO_PRIORITY, CLO_TIME, sptk::CLP_NOTICE, m_buffer, m_defaultPriority, m_indent, m_minPriority, m_options, and sptk::CLogStreamBuf::parent().
| virtual const CLogPriority& sptk::CBaseLog::defaultPriority | ( | ) | const [inline, virtual] |
Returns the default priority.
The default priority is used for the new message, if you are not defining priority.
Reimplemented in sptk::CProxyLog.
References m_defaultPriority.
| virtual void sptk::CBaseLog::defaultPriority | ( | CLogPriority & | priority | ) | [inline, virtual] |
Sets the default priority.
The default priority is used for the new message, if you are not defining priority.
| priority | CLogPriority&, new default priority |
Reimplemented in sptk::CProxyLog.
References m_defaultPriority.
Referenced by sptk::CProxyLog::defaultPriority().
| virtual const CLogPriority& sptk::CBaseLog::minPriority | ( | ) | const [inline, virtual] |
Returns the min priority.
Messages with priority less than requested are ignored
Reimplemented in sptk::CProxyLog.
References m_minPriority.
| virtual void sptk::CBaseLog::minPriority | ( | const CLogPriority & | prt | ) | [inline, virtual] |
Sets min message priority.
Messages with priority less than requested are ignored
| prt | const CLogPriority&, min message priority |
Reimplemented in sptk::CProxyLog.
References m_minPriority.
Referenced by sptk::CProxyLog::minPriority().
| int sptk::CBaseLog::options | ( | ) | const [inline] |
| void sptk::CBaseLog::options | ( | int | ops | ) | [inline] |
| void sptk::CBaseLog::priority | ( | const CLogPriority & | prt | ) | [inline] |
Sets current message priority.
| prt | const CLogPriority&, current message priority |
References m_buffer, and sptk::CLogStreamBuf::priority().
| virtual void sptk::CBaseLog::saveMessage | ( | CDateTime | date, | |
| const char * | message, | |||
| uint32_t | sz, | |||
| const CLogPriority * | priority | |||
| ) | throw (CException) [inline, virtual] |
Stores or sends log message to actual destination.
This method should be overwritten by the actual log implementation
| date | CDateTime, message timestamp | |
| message | const char *, message text | |
| sz | uint32_t, message size | |
| priority | CLogPriority, message priority. |
Reimplemented in sptk::CFileLog, sptk::CProxyLog, and sptk::CSysLog.