Difference between revisions of "Experimental:Debug module"
(Created page with "{{lowercase}}{{#index:debug Class}}{{TDClassSummary|label=debug|summary=The <code>debug</code> module is a member of the Tdu Module that facilitates debug print statements...") |
|||
Line 1: | Line 1: | ||
− | {{lowercase}}{{#index:debug Class}}{{TDClassSummary|label=debug|summary=The <code>debug</code> module | + | {{lowercase}}{{#index:debug Class}}{{TDClassSummary|label=debug|summary=The <code>debug</code> module facilitates debug print statements to the textport. It also contains utilities for customizing those statements and building customized debug output. It is a member of [[Tdu Module]].}} |
<section begin=HELPBODY /> | <section begin=HELPBODY /> | ||
{{ClassMemberSection|empty= | {{ClassMemberSection|empty= | ||
Line 22: | Line 22: | ||
functionOverride=None) | functionOverride=None) | ||
|returns=None | |returns=None | ||
− | |text=Set the style for the built in TD debug function. Any arguments passed as | + | |text=Set the style for the built in TD debug function. Any arguments passed as None will leave that feature unchanged. |
− | |||
:<code>useRepr</code>: if True, convert all non-string args to debug to repr(arg) | :<code>useRepr</code>: if True, convert all non-string args to debug to repr(arg) | ||
:<code>showDAT</code>: in debug message, show the DAT where debug was called | :<code>showDAT</code>: in debug message, show the DAT where debug was called |
Revision as of 17:23, 17 October 2020
The debug
module facilitates debug print statements to the textport. It also contains utilities for customizing those statements and building customized debug output. It is a member of Tdu Module.
Members[edit]
style
→ types.SimpleNamespace
:
A namespace containing information about how to process
debug
statements. This data is not meant to be changed directly. Instead, use the setStyle function below.
Methods[edit]
setStyle(useRepr=None, showDAT=None, showFunction=None,
showLineNo=None, suppress=None, formatOverride=None,
functionOverride=None)
→ None
:
Set the style for the built in TD debug function. Any arguments passed as None will leave that feature unchanged.
useRepr
: if True, convert all non-string args to debug to repr(arg)showDAT
: in debug message, show the DAT where debug was calledshowFunction
: in debug message, show function where debug was calledshowLineNo
: in debug message, show line number where debug was calledsuppress
: if True, suppress (don't print) any debug callsformatOverride
: overrides the default message that debug prints. You can use {0}, {1}, and {2} for DAT, function, and line numberfunctionOverride
: overrides the builtin TD debug function. This function will be called with all arguments from any debug calls in your project. Set to False to remove override.
debug(*args)
→ None
:
Print all args and extra debug info (default is DAT and line number) to texport. To change behavior, use the setStyle function.
debugs(*args)
→ str
:
Return the string that would be printed by the debug function. To change behavior, use the setStyle function.
info(*args, stackOffset=0)
→ list
:
Return all args and extra debug info as processed by the debug function. To change behavior, use the setStyle function.
An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.