LogSys Class Reference

#include <log.h>

Class Description

Class for writing out log information to a file.

Remarks
MAX maintains a log file that contains the text of error / warning / information / debug messages generated by the system and plug-ins. This class is used to work with the log and send messages to it. The log file is placed in the Network directory and is called Max.Log. To access this facility from anywhere in MAX use the pointer returned fro the method Interface::Log(). All methods of this class are implemented by the system.
See also
Class Interface.
+ Inheritance diagram for LogSys:

Public Member Functions

virtual ~LogSys ()
 
virtual DWORD LogTypes ()
 
virtual void SetLogTypes (DWORD types)
 
virtual void LogEntry (DWORD type, BOOL dialogue, const MCHAR *title, const MCHAR *format,...)=0
 
virtual void SetQuietMode (bool quiet)=0
 Enables or disables 'quiet' mode. More...
 
virtual bool GetQuietMode ()=0
 Gets the Quiet Mode. More...
 
virtual void SetSessionLogName (const MCHAR *logName)=0
 Sets additional output log file on session basis. More...
 
virtual const MCHARGetSessionLogName ()=0
 Retrieves the additional output log file. More...
 
Log File Longevity
virtual int Longevity ()
 Returns the conditions under which the log is deleted. More...
 
virtual void SetLongevity (int type)
 Sets the conditions under which the log is deleted. More...
 
virtual DWORD LogDays ()
 Returns the conditions under which the log is cleared. More...
 
virtual DWORD LogSize ()
 Returns the size of the current log file in kilobytes (KB). More...
 
virtual void SetLogDays (DWORD days)
 Set the number of days the log is maintained. More...
 
virtual void SetLogSize (DWORD size)
 Set the maximum size in kilobytes (KB) of the log file. More...
 
State
virtual void SaveState (void)=0
 
virtual void LoadState (void)=0
 

Protected Attributes

DWORD valTypes
 
int logLife
 
DWORD logDays
 
DWORD logSize
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

virtual ~LogSys ( )
inlinevirtual
100 { valTypes = types; }
DWORD valTypes
Definition: log.h:94

Member Function Documentation

virtual DWORD LogTypes ( )
inlinevirtual
Remarks
This method is used to find out what log types are enabled. See System Error Log Message Types. The type values are ORed together to create the value returned.
152 { return logLife; }
int logLife
Definition: log.h:95
virtual void SetLogTypes ( DWORD  types)
inlinevirtual
Remarks
This method is used to set the log types that are enabled.
Parameters
types- Sets the type of log messages See System Error Log Message Types.
152 { return logLife; }
int logLife
Definition: log.h:95
virtual void LogEntry ( DWORD  type,
BOOL  dialogue,
const MCHAR title,
const MCHAR format,
  ... 
)
pure virtual
Remarks
This method is used to log the error.
Parameters
type- Defines the type of log entry defined in this header file. See System Error Log Message Types.
dialogue- One of the following values:
  • NO_DIALOG - If this entry is just some information you don't want a dialogue for, or if you are handling the dialogue yourself use this value.
  • DISPLAY_DIALOG - Use this value if you want the message to be displayed in a dialogue. The system will determine if displaying a dialogue is appropriate based on network rendering mode.
title- This title string is optional. If non NULL, it will be used to define the module.
format- This parameter (and any other additional arguments that follow) make up the format specification. The format matches the standard C printf() function.
TheManager-\>Max()-\>Log()-\>LogEntry(SYSLOG_ERROR, NO_DIALOG, _M("Warning Title") ,_M("%s - %s\n"), ShortDesc(), errText);
virtual void SetQuietMode ( bool  quiet)
pure virtual

Enables or disables 'quiet' mode.

Remarks
When set to quiet mode, the LogSys::LogEntry(...) method will not bring up any dialog boxes. Thus it will act as it does in network rendering mode. That is the error will only be written to the log file.
Note
After setting quiet mode, do not forget to clear it when you are done, since the user will not see any error messages from the renderer while quiet mode is enabled.
Parameters
quiet- TRUE to enable, FALSE to disable.
virtual bool GetQuietMode ( )
pure virtual

Gets the Quiet Mode.

Returns
TRUE if 'quiet' mode is enabled or FALSE if it's disabled.
virtual void SetSessionLogName ( const MCHAR logName)
pure virtual

Sets additional output log file on session basis.

This method defines additional log file in specified location. Unlike default max.log file, the output is based on session. If the given file exists, its contents are destroyed.

Parameters
[in]logName- output file name
virtual const MCHAR* GetSessionLogName ( )
pure virtual

Retrieves the additional output log file.

Returns
- the output file name set in SetSessionLogName() call or NULL if no file specified.
virtual int Longevity ( )
inlinevirtual

Returns the conditions under which the log is deleted.

Returns
One of the following values:
  • SYSLOG_LIFE_EVER - The log is never deleted.
  • SYSLOG_LIFE_DAYS - This log is maintained for this number of days.
  • SYSLOG_LIFE_SIZE - The log is maintained until it reaches this many kilobytes (KB).
166 { return logDays; }
DWORD logDays
Definition: log.h:96
virtual void SetLongevity ( int  type)
inlinevirtual

Sets the conditions under which the log is deleted.

Parameters
type- One of the following values:
  • SYSLOG_LIFE_EVER - The log is never deleted.
  • SYSLOG_LIFE_DAYS - This log is maintained for this number of days.
  • SYSLOG_LIFE_SIZE - The log is maintained until it reaches this many kilobytes (KB).
174 { logDays = days; }
DWORD logDays
Definition: log.h:96
virtual DWORD LogDays ( )
inlinevirtual

Returns the conditions under which the log is cleared.

Returns
One of the following values:
  • SYSLOG_LIFE_EVER - The log is never deleted.
  • SYSLOG_LIFE_DAYS - This log is maintained for this number of days.
  • SYSLOG_LIFE_SIZE - The log is maintained until it reaches this many kilobytes (KB).
179 { logSize = size; }
DWORD logSize
Definition: log.h:97
virtual DWORD LogSize ( )
inlinevirtual

Returns the size of the current log file in kilobytes (KB).

virtual void SetLogDays ( DWORD  days)
inlinevirtual

Set the number of days the log is maintained.

Parameters
days- The number of days to maintain the log. After this many days after creation the log is deleted.
virtual void SetLogSize ( DWORD  size)
inlinevirtual

Set the maximum size in kilobytes (KB) of the log file.

After this size is reached the log file is deleted.

Parameters
size- The maximum size in kilobytes (KB) of the log file.
virtual void SaveState ( void  )
pure virtual
Remarks
This method is used internally.
virtual void LoadState ( void  )
pure virtual
Remarks
This method is used internally.

Member Data Documentation

DWORD valTypes
protected
int logLife
protected
DWORD logDays
protected
DWORD logSize
protected