|
{{TableOfContents}}
|
This page describes how to bebug a tbwiki instance.
|
This page describes how to bebug a tbwiki instance.
|
|
== debug and diagnostic messages ==
Inside the wiki code itself, use ``req.add_to_message()`` to show a message
that will appear in the client browser
|
|
== debug log ==
tbwiki supports a debug log, which is found at:
req.conf.data_dir + "tbwiki-debug.log"
|
Entries can be added to the debug log by calling the req.debug_log(msg) function.
|
Entries can be added to the debug log by calling the ``req.debug_log(msg)`` function.
|
|
=== activating the debug log from configuration file ===
In cgi-bin/<wiki_name>.cgi, set the ``do_debug`` variable
in the config class instance, like so:
|
|
{{{#!YellowBox
config.do_debug = True
}}}
|
This should be done before calling main(req) in the .cgi file.
|
This should be done before calling main(req) in the .cgi file.
|
|
=== activating the debug log by URL ===
You can also activate this by adding "?debug=true" to any valid wiki URL.
|
For example: https://bird.org/tbwiki/FrontPage?debug=true
|
For example: https://bird.org/tbwiki/FrontPage?debug=true
|
|
{{{#!YellowBox
2024-11-04_17:32:42.20 - in main(), action='show'
}}}
|
|
=== debug log extra string ===
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
|
For example: https://bird.org/tbwiki/FrontPage?debug=testing_front_page_url
|
Results in (at least) the following log entry:
{{{#!YellowBox
2024-11-04_17:32:42.20 - [testing_front_page_url] in main(), action='show'
}}}
|
Results in (at least) the following log entry:
{{{#!YellowBox
2024-11-04_17:32:42.20 - [testing_front_page_url] in main(), action='show'
}}}
|