//Log priority
typedef enum _LogPriority
{
lpDebug,
lpMessage,
lpCritical,
lpError
} LogPriority;
//The external log
class CErrorLog
{
friend class CErrorHandler;
public:
//Do we auto flush?
//If so, will try to flush medium after each write
void SetAutoFlush(BOOL bFlush);
BOOL GetAutoFlush()const;
//Assignment operator
CErrorLog& operator=(const CErrorLog& rLog);
//Ctor and Dtor
CErrorLog();
CErrorLog(const CErrorLog& rLog);
virtual ~CErrorLog();
protected:
//Report an error must overide
virtual void ReportError(const std::string& rClass,
const std::string& rMethod,
const std::string& rMessage)=0;
//Report a regular message
virtual void WriteMessage(const std::string& rClass,
const std::string& rMethod,
const std::string& rMessage,
LogPriority aPriority)=0;
private:
//Do we auto flush
BOOL m_bAutoFlush;
};