Public Member Functions | Protected Attributes

LogSys Class Reference

This reference page is linked to from the following overview topics: Calling MAXScript from C++.


Search for all occurrences

Detailed 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.

#include <log.h>

Inheritance diagram for LogSys:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Protected Attributes

DWORD  valTypes
int  logLife
DWORD  logDays
DWORD  logSize

Constructor & Destructor Documentation

virtual ~LogSys ( ) [inline, virtual]
{;}

Member Function Documentation

virtual DWORD LogTypes ( ) [inline, virtual]
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.
{ return valTypes; }
virtual void SetLogTypes ( DWORD  types ) [inline, virtual]
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.
{ valTypes = types; }
virtual void LogEntry ( DWORD  type,
BOOL  dialogue,
MCHAR *  title,
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. 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 ( 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 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 ( ) [inline, virtual]

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).
{ return logLife; }
virtual void SetLongevity ( int  type ) [inline, virtual]

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).
{ logLife = type; }
virtual DWORD LogDays ( ) [inline, virtual]

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).
{ return logDays; }
virtual DWORD LogSize ( ) [inline, virtual]

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

{ return logSize; }
virtual void SetLogDays ( DWORD  days ) [inline, virtual]

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.
{ logDays = days; }
virtual void SetLogSize ( DWORD  size ) [inline, virtual]

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.
{ logSize = size; }
virtual void SaveState ( void  ) [pure virtual]

State

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]

LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys
LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys LogSys