log.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // ----------------
00003 // File ....: log.h
00004 // ----------------
00005 // Author...: Gus Grubba
00006 // Date ....: November 1996
00007 //
00008 // History .: Nov, 27 1996 - Started
00009 //
00010 //-----------------------------------------------------------------------------
00011         
00012 #pragma once
00013 #include <WTypes.h>
00014 #include "strbasic.h"
00015 #include "maxheap.h"
00016 
00017 #define NO_DIALOG       FALSE
00018 #define DISPLAY_DIALOG  TRUE
00019 
00034 #define SYSLOG_ERROR        0x00000001  
00035 
00038 #define SYSLOG_WARN         0x00000002  //!< A warning message.
00039 
00040 #define SYSLOG_INFO         0x00000004  //!< An information message. 
00041 
00043 #define SYSLOG_DEBUG        0x00000008  //!< A debug message. 
00044 #define SYSLOG_BROADCAST    0x00010000  //!< 
00045 #define SYSLOG_MR           0x00020000  //!< 
00046 
00047 
00048 #define SYSLOG_LIFE_EVER    0
00049 #define SYSLOG_LIFE_DAYS    1
00050 #define SYSLOG_LIFE_SIZE    2
00051 
00061 class LogSys : public MaxHeapOperators
00062 {
00063     protected:
00064         DWORD   valTypes;
00065         int     logLife;
00066         DWORD   logDays;
00067         DWORD   logSize;
00068 
00069      public:
00070          virtual ~LogSys() {;}
00071 
00072         //-- Maintenance methods -----------------------------------------------
00073         //
00074         //   Methods used internally
00075 
00078         virtual     DWORD   LogTypes ( ) { return valTypes; }
00079 
00083         virtual     void    SetLogTypes ( DWORD types ) { valTypes = types; }
00084 
00099         virtual     void    LogEntry        ( DWORD type, BOOL dialogue, MCHAR* title, MCHAR* format, ... ) = 0;
00100 
00110         virtual     void    SetQuietMode( bool quiet ) = 0;
00111 
00114         virtual     bool    GetQuietMode( ) = 0;
00115         
00117 
00121         virtual     void    SetSessionLogName   ( MCHAR* logName ) = 0;
00122         
00124 
00126         virtual     MCHAR * GetSessionLogName   ( )= 0;
00127 
00129 
00130 
00135         virtual     int     Longevity       ( )             { return logLife; }
00136         
00142         virtual     void    SetLongevity    ( int type )    { logLife = type; }
00143 
00149         virtual     DWORD   LogDays         ( )             { return logDays; }
00150         
00152         virtual     DWORD   LogSize         ( )             { return logSize; }
00153         
00157         virtual     void    SetLogDays      ( DWORD days )  { logDays = days; }
00158 
00162         virtual     void    SetLogSize      ( DWORD size )  { logSize = size; }
00164 
00166 
00167 
00168         virtual     void    SaveState       ( void ) = 0;
00170         virtual     void    LoadState       ( void ) = 0;
00172 };
00173