11. Debugging
Debugging
11.1 Summary
T.A.R.B.S. engine comes with some useful debugging tools. Enabling the debugger helps to see whats going on under the hood. Debugging enables you to find out, specifically, what is causing an issue in your code. Debugging is enabled by updating the value of a var.
When TARBSengine.debug
is set to true, it enables the TARBSengine.debugout
function to execute. debugout
prints what happened when a function executed. For example, if you call Player.editinv
with debugging enabled, it will output Debugger: item given {item} x {amount}
. The debugger told us what's going on. This allows us to figure out what is causing the issue. If you multiple functions, and something is working improperly, debugging mode can let you know, specifically, which function is causing a problem.
11.2 Logging
When executing a program made with T.A.R.B.S., a log file is now generated. The log file keeps track of every debug output and when they occurred. This can help in the debugging stage of development to view re-occurring errors, especially if the errors are well handled and don't exit the program when encountered. Logging is preformed automatically, as long as it is enabled. Logging can be enabled by setting the TARBSengine.enable_logging
var to true and generating the log.
While logging is enabled, every event that takes place will be added to a timestamped log file. This can help keep track of errors and what could be causing the error. Example log:
11.3 Examples
11.4 Reporting Functions
The reporting functions are used to send reports and feature requests to me through GitHub directly from your code or terminal. For most of the functions, a GitHub token is required. This token allows you to log into GitHub through the API. To generate a personal access token, go here, click generate new token, add a token description to remember what it is for, select the public repo scope (this permission only grants access to public repos, such as adding issues and comments to public repos, and starring them) (you can read more about personal access tokens here)
Reporting functions:
issue(token, title, body)
token
: Access token for accounttitle
: The title of the issue reportbody
: The body/description for the issue report
feature(token, title, body)
token
: Access token for accounttitle
: The title of the feature requestbody
: The body/description for the feature request
Usage example:
To ensure that your feature can be accommodated or your bug report is handled, please describe your issue or request in detail to the best of your ability.
Last updated