Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

commandLogging [-historySize uint] [-logCommands boolean] [-logFile string] [-recordCommands boolean] [-resetLogFile]

commandLogging is undoable, queryable, and NOT editable.

This command controls logging of Maya commands, in memory and on disk.

Note that if commands are logged in memory, they will be available to the crash reporter and appear in crash logs.

Return value

None

In query mode, return type is based on queried flag.

Flags

historySize, logCommands, logFile, recordCommands, resetLogFile
Long name (short name) Argument types Properties
-historySize(-hs) uint createquery
Sets the number of entries in the in-memory command history.
-logCommands(-lc) boolean createquery
Enables or disables the on-disk logging of commands.
-logFile(-lf) string createquery
Sets the filename to use for the on-disk log. If logging is active, the current file will be closed before the new one is opened.
-recordCommands(-rc) boolean createquery
Enables or disables the in-memory logging of commands.
-resetLogFile(-rl) createquery
Reset the log filename to the default ('mayaCommandLog.txt' in the application folder, alongside 'Maya.env' and the default projects folder).

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

// Set the number of commands logged in memory to 20
//
commandLogging -historySize 20;

// Query the number of commands being logged in memory
//
commandLogging -q -historySize;
// Result: 20 //

// Query the log file location
//
commandLogging -q -logFile;
// Result: C:/Users/foobar/Documents/maya/mayaCommandLog.txt //

// Change the log file location
//
commandLogging -logFile "C:/temp/log.txt";

// Reset the log file to default
//
commandLogging -resetLogFile;