Index  Previous: ADMINISTERING MINIVEND   Next: MANUAL INSTALLATION OF CATALOGS

DEBUGGING

As of version 3.06, MiniVend allows you to see debugging information based on the state of several controls.

MiniVend comes with debugging output disabled by default -- this is for speed and code compactness. To enable debugging, change directory to the MiniVend root (the software directory) and run:

    # Must change to MiniVend software directory first!
    bin/ifdef -y -t DEBUG

This only works for MiniVend 3.06 and above. Earlier MiniVend versions have only a crude debug available with the -D startup options.

To disable, use the command

    # Must change to MiniVend software directory first!
    bin/ifdef -n -t DEBUG

Note that some warnings may be generated by the debugging itself, typically ``use of uninitialized variable'' warnings generated by undefined debug references. You can safely ignore these if they occur pointing to lines where the logDebug routine is called.

The controls are accessed in one of several ways.

-Dnnnn
If you start MiniVend with the -D option, it will run in the foreground and extensive debug information will be output on the terminal that started the program. If nnnn, a numeric option set, is present, that debug level will be set. The default level is 4097, running in the foreground with only a few debug outputs (normal mode) present. If you want to run in the foreground with maximum information, use the level 4351.

IMPORTANT NOTE: This may affect some program operations. If something new fails in debug mode, try it again in normal background server mode. In particular, changes to the configuration made on the fly in the page will stick since the process is not forked.

[tag flag debug] level1 level2 ... [/tag]
This sets the debug level in the page. If you want to see what is happening with a particular type of operation, the debug levels are:

    DESCRIPTION           NUM  TEXT    DISABLE
    -----------           ---  -----   -----
    Disable all debug       0  off     N/A
    Normal operations       1  normal  !normal
    Tag interpretation      2  tag     !tag
    Database operations     4  data    !data
    Configuration info      8  config  !config
    Search operations      16  search  !search
    Session operations     32  session !session
    Server operations      64  server  !server
    Cache/benchmark       128  cache   !cache
    Show calling package  512  caller  !caller
    Show in page comment 1024  comment !comment
    Place in mvdebug     2048  N/A     N/A
    Run in foreground    4096  N/A     N/A
 
    Verbose in HTML      2047
    Verbose foreground   5119

NOTE: The text levels only operate in conjunction with [tag flag debug].

If you want to output the debug information embedded in an HTML comment at the end of the page you get from your browser, add level 1024. This overrides the output to mvdebug temporarily, or to foreground output indefinitely, if those are enabled.

Use this to set verbose but no tag details, with output to HTML:

    [tag flag debug]comment verbose !tag[/tag]

Use this to look at only database operations, with output to HTML:

    [tag flag debug]comment !verbose data[/tag]

MINIVEND_DEBUG environment variable
Prior to starting the server, you can determine the level to run at by setting the environment variable MINIVEND_DEBUG. It is an ANDed set of debug levels yielding a decimal number. For example, to show debug information in HTML comments with maximum verbosity, use one of the following command prior to starting the MiniVend daemons:

   # UNIX C-shell types (tcsh, csh, etc.)
   setenv MINIVEND_DEBUG 1279

   # UNIX Bourne-shell types (bash, sh, ksh, etc.)
   MINIVEND_DEBUG=1279
   export MINIVEND_DEBUG

   # Windows/DOS command box
   set MINIVEND_DEBUG=1279

DebugMode directive
The debug mode can be set both globally (in minivend.cfg) and for each catalog (in catalog.cfg) with the DebugMode directive, with levels as above.

DisplayErrors
To enable display of fatal errors (those things that would normally cause a 500 server error) then the DisplayErrors directive must be set to Yes in both minivend.cfg and catalog.cfg. Debug information will be included if available and level 1024 is set.

The debug mode of 8192 will enable DisplayErrors for every catalog.



Index  Previous: ADMINISTERING MINIVEND   Next: MANUAL INSTALLATION OF CATALOGS