Log System

System Globals:

<filename>logsystem.getNetLogFileName() 

Returns the current log filename.

EXAMPLE:

logsystem.getNetLogFileName()
"C:\Users\Garfield\AppData\Local\Autodesk\3dsMax\2017 - 64bit\ENU\Network\Max.log"

   

logsystem.longevity SystemGlobal:longevity default:#size

Gets/sets the log file longevity mode. Available in 3ds Max 2017 and higher.

This setting corresponds to the Customize > Preferences > Files > “Log File Maintenance” radio buttons state.

Possible values are:

   

logsystem.logDays SystemGlobal:logDays default:30

Gets/sets the number of days to keep the log file entries. Corresponds to the Customize > Preferences > Files > Log File Maintenance > “Maintain only XX Days” option. Available in 3ds Max 2017 and higher.

Used when logsystem.longevity is set to #days.

   

logsystem.logSize SystemGlobal:logSize default:256

Gets/sets the maximum log file size in Kilobytes to keep. Corresponds to the Customize > Preferences > Files > Log File Maintenance > “Maintain only XX Kbytes” option. Available in 3ds Max 2017 and higher.

Used when logsystem.longevity is set to #size, which is the default mode.

   

Methods:

logsystem.logEntry <string> [debug:<bool>] [info:<bool>] [warning:<bool>] [error:<bool>]
logsystem.logEntry <string> <enum>

Outputs the string to the log file, based on the various type keyword parameters, or enum value.

The possible enum values are: #error, #warning, #info, #debug. Available in 3ds Max 2017.1 Update and higher

Default values are: debug:true, info:false, warning:false, error:false.

Output to the log file is filtered by the settings in the Preference Settings dialog, Files tab.

EXAMPLE:

logsystem.logEntry "My Warning Message" warning:true
logsystem.logEntry "My Warning Message" #warning

   

<filename>logsystem.logName <filename>

Sets an extra log file to the given filename. This log file is not persistent. This log file is in addition to the normal log file, which can be accessed via logsystem.getNetLogFileName() (below).

If the log file was created successfully, returns the new log name.

If the new file creation failed, returns the current log file name.

If the given filename already exists, its contents are over-written.

Available in 3ds Max 9 and higher.

EXAMPLE:

logsystem.logName "c:\\extra.log"
"c:\extra.log"
logsystem.logName "z:\\extra.log" --Z: does not exist, keeps old log
"c:\extra.log"

   

logsystem.setLogLevel debug:<bool> info:<bool> warning:<bool> error:<bool>
logsystem.setLogLevel <#error | #warning | #info | #debug> <bool>

Sets the specified logging levels on or off. For any logging levels not specified, the existing setting is retained. Available in 3ds Max 2017.1 Update and higher.

EXAMPLE:

logsystem.setLogLevel error:true warning:true info:false debug:false
logsystem.setLogLevel #debug false

   

<filename>logsystem.getLogLevel <#error | #warning | #info | #debug>

Gets the status (on or off) for the specified logging level. Available in 3ds Max 2017.1 Update and higher.

EXAMPLE:

errorLoggingEnabled = logsystem.getLogLevel #error

   

<filename>logsystem.saveState() 

Saves the state of the log system preferences. Normally, changing the log system settings like logsystem.longevity will only affect the current 3ds Max session. Available in 3ds Max 2017 and higher

Calling this function will commit the changes to stick between 3ds Max sessions.

   

logsystem.quietMode default:false

Lets you get and set whether error logging quiet mode is enabled.

A Boolean value set to true when you do not want error messages from the renderer to bring up dialog boxes.

If set to false , error messages from the renderer will bring up dialog boxes.

3ds Max sets the corresponding internal variable to true during network rendering to suppress error messages such as the "Missing Maps" and "Missing Map Coordinates" dialogs.

If this variable is set to true and the renderer generates an error message, the renderer will exit.

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.

See Also