DocCommandLineClient >> DocInternalAPI >> BugListLongQuery >> DocDebug 

TB Wiki

Login

DocDebug

This page describes how to bebug a tbwiki instance.

debug and diagnostic messages [edit section]

Inside the wiki code itself, use req.add_to_message() to show a message that will appear in the client browser

debug log [edit section]

tbwiki supports a debug log, which is found at:

req.config.data_dir + "tbwiki-debug.log"

Entries can be added to the debug log by calling the req.debug_log(msg) function. This can be called from anywhere in tbwiki_engine.py, any Macro or Processor, or the associated auxiliary modules (datascan, table, etc.)

The debug log is visible from the web interface, using the DebugLog processor. Usually, this processor is placed on the SystemInfo page. You can read the current contents of the debug log, and clear the log, using that interface.

activating the debug log from configuration file [edit section]

In cgi-bin/<wiki_name>.cgi, set the do_debug variable in the config class instance, like so:

    config.do_debug = True

This should be done before calling main(req) in the .cgi file.

activating the debug log by URL [edit section]

You can also activate this by adding "?debug=true" to any valid wiki URL.

For example: https://bird.org/tbwiki/FrontPage?debug=true

    2024-11-04_17:32:42.20 - in main(), action='show'

debug log extra string [edit section]

If you specify an string for the value of "debug" other than "true", then this will appear in log entries for that URL response.

For example: https://bird.org/tbwiki/FrontPage?debug=testing_front_page_url

Results in (at least) the following log entry:

    2024-11-04_17:32:42.20 - [testing_front_page_url] in main(), action='show'

Categories: Documentation
TBWiki engine 2.0.1 by Tim Bird