Using the Python Logger
 
 
 

The Python Logger sends information to a log file about each line in a script as it is executed. Even if a script creates instability in MotionBuilder, the last line of code executed before the crash is written to this log file. You can access this file through the Python Editor, or directly from the file system.

To create a log file for executed Python scripts:

  1. Open the problematic script in the Python Editor.
  2. On the Python Editor toolbar, click the Python Logger button .

    The Python Logger loads with the current script displayed.

  3. If this is not the script you want to validate, click Browse and locate your file.
  4. Click Log Execution to execute the script.

    By default, the Logger is off, and no log file is written.

  5. To start the Logger silently, press F7.

    If MotionBuilder becomes unstable, restart it and open the Python Editor, then the Python Logger.

  6. Do either of the following:
    • Click "Print last exec line" or "Print exec log". .

      The log file is written to [MotionBuilder]\bin\lastexec.log.

    • Specify a custom file by clicking Browse and selecting it.

      The logger script is implemented as mbdebugger.py.