OOF2: The Manual

Name

OOF.Help.Debug.Debug — Turn debugging mode on and off.

Synopsis

OOF.Help.Debug.Debug(boolean)

Details

  • Parent Menu: OOF.Help.Debug
  • Callback: function set_debug in module ooflib.common.IO.mainmenu
  • Parameters:

    boolean
    A boolean value, 0 (false) or 1 (true). This is not a keyword parameter. In scripts, just enter '0' or '1', not 'boolean=1'.

Description

Calling this command with an argument of True turns debugging mode on. Calling with with an argument of False turns it off. In debugging mode, menu commands are echoed to the terminal from which OOF2 was launched, along with other debugging information.

Debugging mode can also be turned on by providing the --debug command line argument. Doing it this way initializes the random number generator with a special seed (17, the most random integer) and adds a few more testing commands to the OOF.Help.Debug menu. Initializing the random number is done to ensure that program behavior is deterministic in debug mode.

Echoed commands look like this:

    -10013-2003--------------- ====40027==== 5OOF.Skeleton.New(name='bones', ...))
  

1

The stack depth of the Python interpreter.

2

The thread that the command is running on.

3

The number of dashes is the same as the stack depth, to make it easier to recognized nested routines.

4

The sequence number of the command.

5

The menu command itself.

Other debugging output looks like this:

    -10004-2023------ 4mainmenu.py5(115):6loaddata 7done loading oofdata.py
  

1

The stack depth of the Python interpreter.

2

The thread that is printing the message.

3

A number of dashes equal to the stack depth.

4

The file containing the code containing the debugging line.

5

The location within the file of the debugging line.

6

The function containing the debugging line.

7

The debugging message itself.