### Configure Tracy with Native PHP Session (Start Early) Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Use this method when session initialization requires complex setup. Tracy is enabled first to catch errors, then the session is initialized and dispatched. ```php Debugger::setSessionStorage(new Tracy\NativeSession); Debugger::enable(); // followed by session initialization // and start the session session_start(); Debugger::dispatch(); ``` -------------------------------- ### Install Tracy via Composer Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md The recommended way to install Tracy is using Composer. This command fetches and installs the latest stable version of the Tracy package. ```shell composer require tracy/tracy ``` -------------------------------- ### Configure Tracy with Native PHP Session (Start Before Tracy) Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Enable Tracy to use the native PHP session. Ensure `session_start()` is called before `Debugger::enable()`. ```php session_start(); Debugger::setSessionStorage(new Tracy\NativeSession); Debugger::enable(); ``` -------------------------------- ### Example barDump Outputs Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Demonstrates naming outputs in the Dumps panel using the second optional parameter and shows the link to the file and line number where the calls were triggered. ```php bd($page->body, 'Body'); bd(array('a' => array(1,2,3), 'b' => array(4,5,6)), 'Test Array'); ``` -------------------------------- ### TODO Panel Specified Directories Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Define additional directories to scan for TODO items, separated by line breaks. Example includes 'site/classes' and 'site/modules/MyModuleName'. ```text @example: site/classes site/modules/MyModuleName ``` -------------------------------- ### Start and dump timer Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Measures the execution time of a block of code. You can optionally name timers to dump multiple measurements. ```php t(); // insert resource intensive code here sleep(2); bd(t()); ``` -------------------------------- ### PHP Fatal Error with Stack Trace Example Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md This example shows a PHP fatal error with a stack trace as it might appear in the source code without Tracy. ```text Fatal error: Uncaught Nette\MemberAccessException: Call to undefined method Nette\Application\UI\Form::addTest()? in /sandbox/vendor/nette/utils/src/Utils/ObjectMixin.php:100 Stack trace: #0 /sandbox/vendor/nette/utils/src/Utils/Object.php(75): Nette\Utils\ObjectMixin::call(Object(Nette\Application\UI\Form), 'addTest', Array) #1 /sandbox/app/forms/SignFormFactory.php(32): Nette\Object->__call('addTest', Array) #2 /sandbox/app/presenters/SignPresenter.php(21): App\Forms\SignFormFactory->create() #3 /sandbox/vendor/nette/component-model/src/ComponentModel/Container.php(181): App\Presenters\SignPresenter->createComponentSignInForm('signInForm') #4 /sandbox/vendor/nette/component-model/src/ComponentModel/Container.php(139): Nette\ComponentModel\Container->createComponent('signInForm') #5 /sandbox/temp/cache/latte/15206b353f351f6bfca2c36cc.php(17): Nette\ComponentModel\Co in /sandbox/vendor/nette/utils/src/Utils/ObjectMixin.php on line 100
``` -------------------------------- ### User Switcher Selector Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Defines the criteria for selecting users available in the User Switcher panel. This example limits users to those with the 'editor' role created within the last 30 days. ```text @example: roles=editor, created>=-30days ``` -------------------------------- ### Get the Current Live Request Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Retrieve the current live request data. This method does not rely on Tracy being enabled, only installed. ```php $liveRequest = $page->getRequestData('current'); ``` -------------------------------- ### AI SQL Assistant Open WebUI API URL Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Provide the base URL for an Open WebUI or OpenAI-compatible chat endpoint. Leave blank to disable. Example provided. ```text @example: http://127.0.0.1:8080 ``` -------------------------------- ### PHP Parse Error Example Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md This is an example of how a PHP parse error is displayed in the source code without Tracy. ```text Parse error: syntax error, unexpected '}' in HomepagePresenter.php on line 15 ``` -------------------------------- ### Integrate Monolog with Tracy Logger Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Adapts a Monolog logger to be used by Tracy Debugger. Ensure Monolog and Tracy are installed and configured. ```php $monolog = new Monolog\Logger('main-channel'); $monolog->pushHandler(new Monolog\Handler\StreamHandler($logFilePath, Monolog\Logger::DEBUG)); $tracyLogger = new Tracy\Bridges\Psr\PsrToTracyLoggerAdapter($monolog); Debugger::setLogger($tracyLogger); Debugger::enable(); Debugger::log('info'); // writes: [] main-channel.INFO: info [] [] Debugger::log('warning', Debugger::WARNING); // writes: [] main-channel.WARNING: warning [] [] ``` -------------------------------- ### Request Logger Methods Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Configures which HTTP request methods are logged by the Request Logger. The default includes all common methods. Disabling GET can ignore normal page visits. ```text @options: GET | POST | PUT | DELETE | PATCH @default: GET | POST | PUT | DELETE | PATCH ``` -------------------------------- ### User Development Template Suffix Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Defines the suffix for user-specific template files. For example, 'dev' will look for 'home-dev.php' if the user has a 'tracy-home-dev' permission. ```plaintext @example: dev ``` -------------------------------- ### Get raw SQL query Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Retrieves the raw SQL query generated by ProcessWire for a given selector. Useful for debugging find() operations. ```php bd(TD::sql('template=basic-page, title%=hello, sort=-created')); ``` -------------------------------- ### Custom User Bar Features (PHP) Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Allows custom PHP code to generate output for the User Bar. This example creates a link to Google PageSpeed Insights. ```php @example return ''; ``` -------------------------------- ### Debug All Methods Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Shortcut for outputting via all dump/log methods with a single call. Use for comprehensive debugging output. ```php da($var, $title, $options); ``` -------------------------------- ### Get All Logged Requests Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Retrieve an array containing all logged requests for the current page. ```php $allRequests = $page->getRequestData(); ``` -------------------------------- ### Configure Dump Location Options Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets how the location of dump() and barDump() calls are displayed. Options include showing the source file path in a tooltip, adding a link to open the file, or showing the class definition file path. ```text @options: LOCATION_SOURCE | LOCATION_LINK | LOCATION_CLASS @default: all enabled ``` -------------------------------- ### Get the Last Logged Request Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Retrieve only the most recent logged request by passing 'true' as an argument. ```php $lastRequest = $page->getRequestData(true); ``` -------------------------------- ### Enable Tracy with Development/Production Constants Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Directly set the development or production mode for Tracy using predefined constants. This is useful for explicitly controlling the environment. ```php Debugger::enable(Debugger::Development); Debugger::enable(Debugger::Production); ``` -------------------------------- ### User Bar Background Color Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies the background color for the user bar. Leave blank for transparent. Example: '#FFFFFF'. ```plaintext @example: #FFFFFF ``` -------------------------------- ### Enable Shortcut Methods Option Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Configure whether shortcut methods are enabled or disabled. Defaults to enabled. Disabling can prevent name clashes. ```text @options: enabled | disabled @default: enabled ``` -------------------------------- ### ProcessWire Info Panel Sections Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Configure which sections are displayed in the ProcessWire Info panel. Defaults to all sections. ```text @options: Versions List | Admin Links | Documentation Links | Goto Page By ID | ProcessWire Website Search @default: all ``` -------------------------------- ### Configure __debugInfo() Method Usage Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Determines whether to use the __debugInfo() magic method for dumping objects. This can result in cleaner dumps but might hide some information. It can be overridden per call. ```text @options: enabled | disabled @default: enabled ``` -------------------------------- ### Enable Tracy Debugger Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Activate Tracy by calling Tracy\Debugger::enable() at the beginning of your program before any output is sent. Ensure you include the autoloader or tracy.phar. ```php use Tracy\Debugger; require 'vendor/autoload.php'; // alternatively tracy.phar Debugger::enable(); ``` -------------------------------- ### List of Enabled Shortcut Methods Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md View the available shortcut methods and their corresponding full Tracy Debugger methods. Useful for managing potential 'previously declared' errors. ```text @options: addBreakpoint() for TD::addBreakpoint() bp() for TD::addBreakpoint() barDump() for TD::barDump() bd() for TD::barDump() barEcho() for TD::barEcho() be() for TD::barEcho() barDumpBig() for TD::barDumpBig() bdb() for TD::barDumpBig() debugAll() for TD::debugAll() da() for TD::debugAll() dump() for TD::dump() d() for TD::dump() dumpBig() for TD::dumpBig() db() for TD::dumpBig() l() for TD::log() templateVars() for TD::templateVars() tv() for TD::templateVars() timer() for TD::timer() t() for TD::timer() ``` -------------------------------- ### Dump Tabs Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Select and order the tabs available for dumping ProcessWire objects. The first item defaults to the open tab. ```text @options: Debug Info | Full Object @default: Debug Info | Full Object ``` -------------------------------- ### Get Logged Request Data by ID Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Retrieve a specific logged request using its unique ID. The ID is displayed in the Request Logger panel's title. ```php $requestData = $page->getRequestData(123); ``` -------------------------------- ### Dump Variable with Extended Options (barDumpBig) Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Use `bdb()` as a shortcut for `bd()` with increased `maxDepth`, `maxLength`, and `maxItems`. Useful for inspecting larger or more complex data structures when default limits are too restrictive. ```php bdb($var, $title, $options); /** * @param mixed $var string|array|object to be dumped * @param string $title string to identify this dump * @param array $options | maxDepth (default:3), maxLength (default:150), maxItems (default:100) */ ``` -------------------------------- ### Tracy Slack App OAuth Token Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Provides the bot token for the Slack app used to deliver error messages. Requires the 'chat:write' scope and installation to your workspace. ```php @param: xoxb-... token ``` -------------------------------- ### Allowed File Extensions Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md A comma-separated list of file extensions that can be opened in the editor. Limiting the extensions enhances performance. ```ini @default: php, module, js, css, txt, log, htaccess ``` -------------------------------- ### TODO Panel Ignore Directories Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Provide a comma-separated list of directory names to ignore when scanning for TODO items. Default list includes common version control and build directories. ```text @default: git, svn, images, img, errors, sass-cache, node_modules ``` -------------------------------- ### TODO Panel Allowed Extensions Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specify a comma-separated list of file extensions to scan for TODO items. Defaults to common web development file types. ```text @default: php, module, inc, txt, latte, html, htm, md, css, scss, less, js ``` -------------------------------- ### Snippet Paths Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies the directories where TracyDebugger will look for snippets. The default path is provided, and you may need to create these directories. ```ini @options: /site/templates/TracyDebugger/snippets/ | /site/assets/TracyDebugger/snippets/ @default: /site/templates/TracyDebugger/snippets/ ``` -------------------------------- ### Enable Tracy with IP Address Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Enable development mode for Tracy by specifying allowed IP addresses. This allows developers to access debugging information on a production-like environment. ```php Debugger::enable('23.75.345.200'); // you can also provide an array of IP addresses ``` -------------------------------- ### Render Tracy Loader in HTML Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Include this in your HTML template before any scripts to optimize Tracy loading, especially with slow blocking scripts. ```html ... ``` -------------------------------- ### Implement Custom Logger with Tracy Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Create a custom logger by implementing the Tracy\ILogger interface. This allows for custom handling of errors, exceptions, and log messages. ```php use Tracy\ILogger; class SlackLogger implements ILogger { public function log($value, $priority = ILogger::INFO) { // sends a request to Slack } } Tracy\Debugger::setLogger(new SlackLogger); ``` ```neon services: tracy.logger: SlackLogger ``` -------------------------------- ### Dump and Exit/Bar with Tracy Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Use dumpe() to dump a variable and exit, or bdump() to display variables in the Tracy Bar with an optional title. This keeps output clean and organized. ```php bdump([2, 4, 6, 8], 'even numbers up to ten'); bdump([1, 3, 5, 7, 9], 'odd numbers up to ten'); ``` -------------------------------- ### Configure Nginx for Tracy Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Adjust the Nginx `try_files` directive to correctly handle requests for Tracy, especially when using pretty URLs. ```nginx try_files $uri $uri/ /index.php$is_args$args; ``` -------------------------------- ### Default Editor Protocol Handler Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the default protocol handler for opening files in an editor from Tracy. ```text @default: vscode://file/%file:%line ``` -------------------------------- ### Echo String with HTML Support (barEcho) Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Use `be()` to output strings directly to the dumps panel. Supports HTML rendering, allowing for formatted output. The optional second parameter names the output in the panel. ```php be('

My Custom HTML

', 'String'); ``` ```php be('
AB
OneTwo
ThreeFour
', 'Table'); ``` -------------------------------- ### Server Type Indicator Location Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies where the server type indicator should be displayed. Options include 'Backend', 'Frontend', or 'none'. The default is 'none'. ```text @options: Backend | Frontend @default: none ``` -------------------------------- ### Enable Tracy with IP Address and Cookie Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Enable development mode for Tracy using a combination of IP address and a secret cookie. This provides a more secure way to enable debugging for specific developers. ```php Debugger::enable('secret1234@23.75.345.200'); ``` -------------------------------- ### API Explorer: Module Classes Selection Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Allows selection of module classes to be displayed in the API Explorer. Options include 'Core modules' and 'Site modules'. Defaults to 'none'. ```plaintext @options: Core modules | Site modules @default: none ``` -------------------------------- ### Add Custom Link with Label Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies a URL and an optional label for a link to be displayed in the Links panel. One link per line. ```text https://www.google.com | Google Search ``` -------------------------------- ### Set Content Security Policy for Tracy (PHP) Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Configure CSP headers in pure PHP to allow Tracy scripts. A nonce is generated and added to the header. ```php $nonce = base64_encode(random_bytes(20)); header("Content-Security-Policy: script-src 'nonce-$nonce' 'strict-dynamic';"); ``` -------------------------------- ### Server Type Indicator Colors Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Defines the colors used for different server types based on IP address and domain patterns. Entries are in 'type|#color' format. 'local' is detected by IP. ```text @default: local|#FF9933 *.local|#FF9933 dev.* #FF9933 *.test|#FF9933 staging.* #8b0066 *.com|#009900 ``` -------------------------------- ### Log variable with priority Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Logs a variable to a file with a specified priority. The priority determines the log file name. ```php l($var, $priority); ``` -------------------------------- ### Configure Debug Bar Visibility Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Control whether the debug bar is shown on the frontend, backend, or both. ```configuration @options: Frontend | Backend @default: both ``` -------------------------------- ### Request Info: Panel Sections Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies which sections to include in the Request Info panel. A wide range of options are available, including module/template/field settings, input data, and object details. ```plaintext @options: Module Settings | Template Settings | Field Settings | Field Export Code | Page Info | Redirect Info | Page Permissions | Language Info | Template Info | Page Meta | Field List & Values | Server Request | Input GET | Input POST | Input COOKIE | SESSION | Page Object | Template Object | Fields Object | Page/Template Edit Links ``` -------------------------------- ### File Editor Action Buttons Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Describes the available action buttons in the File Editor panel. These allow for testing changes, saving them, resetting to the last saved version, or restoring from backup. ```text * **Test**: reloads the page using the code in the editor - no changes are made to the template file or the code served to all other users of the site. * **Save**: saves the editor code to the template file, making this a live and permanent change. Pressing CMD/CTRL + S saves via AJAX without a page reload. * **Reset**: re-loads the page (and the code in the editor) with the code from the saved file. This is no different from loading the page again, but different from clicking the "reload" button in your browser which will actually send the test code again. * **Restore**: returns the code for the file to the last saved version (restored from automatic backup of the file) ``` -------------------------------- ### Configure Keys to Hide in Dumps Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies keys whose values should be redacted (replaced with '*****') in dumps and bluescreens. This is useful for sensitive information like passwords and tokens. Requires PHP 7.2+. ```text @default: dbPass, dbName, dbUser, user, username, pass, password, pwd, pw, auth, token, secret ``` -------------------------------- ### Enable Tracy in Development Mode Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md To test if Tracy works, especially if the Tracy Bar is not visible, you can temporarily enable it in development mode. This is useful for debugging on non-localhost environments. ```php use Tracy\Debugger; require 'vendor/autoload.php'; Debugger::enable(Debugger::Development); ``` -------------------------------- ### Event Interceptor Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Defines how to configure hooks for interception. Specify the hook, options for execution timing (Before/After), and return behavior (Default/False). ```text @Hook @options: Before | After @default: Before @Return @options: Default | False @default: Default ``` -------------------------------- ### Diagnostics Panel Sections Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specify which sections to include in the Diagnostics panel. Defaults to 'Filesystem Folders'. ```text @options: Filesystem Folders | Filesystem Files | MySQL Info @default: Filesystem Folders ``` -------------------------------- ### Set Tracy Log Directory Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Configure the absolute path to the directory where Tracy should store log files. This is essential for error logging in production mode. ```php Debugger::$logDirectory = __DIR__ . '/log'; ``` -------------------------------- ### AI SQL Assistant Open WebUI Model Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specify the model to use with the Open WebUI endpoint. Defaults to 'gpt-oss:120b'. ```text @default: gpt-oss:120b ``` -------------------------------- ### Code Prefix Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies a code block to be prepended to each snippet stored on disk. This is useful for including 'use' statements or helper functions. ```ini * Useful for `use` statements or helper functions you want available in every snippet. The prefix is prepended before the snippet runs. ``` -------------------------------- ### Excluded Directories Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md A comma-separated list of directories to exclude from the File Editor's file tree. ```ini @default: site/assets ``` -------------------------------- ### dumpBig Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Provides a quick shortcut to a "deeper and longer" dump, suitable for most circumstances where default settings are insufficient. ```APIDOC ## dumpBig The default `maxDepth`, `maxLength`, and `maxItems` settings are set to 3, 150, and 100, respectively. This ensure faster rendering performance and is often all you need. You can of course use the `$options` parameter in `d()` calls to adjust to your exact needs, but this method provides a quick shortcut to a "deeper and longer" version that should be enough in most circumstances. Shortcut to `d($var, $title, array('maxDepth' => 6, 'maxLength' => 9999, 'maxItems' => 250))) ### Parameters ```php db($var, $title, $options); /** * @param mixed $var string|array|object to be dumped * @param string $title string to identify this dump * @param array $options | maxDepth (default:3), maxLength (default:150), maxItems (default:100) */ ``` ``` -------------------------------- ### Set Default Number of Log Entries Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Configures the maximum number of log entries to display in the Tracy and ProcessWire log viewer panels. Defaults to 100. ```ini @options: integer @default: 100 ``` -------------------------------- ### Enable Logging on a Page Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Manually enable request logging for a specific page within the ProcessWire admin interface. ```php $page->logRequests(); ``` -------------------------------- ### Server Type Indicator Display Type Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Chooses how the server type indicator is displayed. Options include 'Indicator on debug bar', 'Custom - control with CSS', 'Add prefix page title', or 'Favicon badge'. The default is 'Favicon badge'. ```text @options: Indicator on debug bar | Custom - control with CSS | Add prefix page title | Favicon badge @default: Favicon badge ``` -------------------------------- ### Set Custom Autocompletion Snippets URL Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Provide a URL for a custom snippets file to serve autocompletions. This can be a local path or a remote URL, such as a Github Gist. Ensure CDNs are used for Gists. ```text pwfind pwforeach ``` -------------------------------- ### File Editor Base Directory Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the highest level directory to be displayed in the File Editor panel. Selecting a more specific directory improves performance. ```ini @options: Root | Site | Templates @default: Templates ``` -------------------------------- ### ProcessWire Custom Links Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Define custom links for the ProcessWire Info panel. Links are stored as paths for portability. Defaults to a predefined set of admin pages. ```text @default: Setup | Templates | Fields | Modules | Users | Roles | Permissions | Profile ``` -------------------------------- ### PhpStorm Editor Protocol Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies the protocol for opening files in PhpStorm. ```text phpstorm://open?file=%file&line=%line ``` -------------------------------- ### Tracy Email Errors 'From' Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies the email address from which error emails will be sent. ```php @param: email address ``` -------------------------------- ### Configure Maximum String Length for Dumps Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the maximum length of strings displayed in dumps. For very long strings, consider using barDumpBig() or per-call options. ```text @default: 150 ``` -------------------------------- ### Set Log Severity for PHP Errors Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Configure which PHP errors (e.g., E_NOTICE, E_WARNING) Tracy should log with detailed information. This helps in capturing and analyzing non-fatal errors. ```php Debugger::$logSeverity = E_NOTICE | E_WARNING; ``` -------------------------------- ### Maximum Backups Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the maximum number of automatically named backups to retain. Older backups are pruned when this limit is reached. ```ini @default: 25 ``` -------------------------------- ### Custom Indicator CSS for Server Type Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Provides custom CSS for the server type indicator when 'Custom - control with CSS' is selected. Uses `[color]` and `[type]` shortcodes for dynamic styling. ```css @default: body::before { content: "[type]"; background: [color]; position: fixed; left: 0; bottom: 100%; color: #ffffff; width: 100vh; padding: 0; text-align: center; font-family: sans-serif; font-weight: 600; text-transform: uppercase; transform: rotate(90deg); transform-origin: bottom left; z-index: 999999; font-size: 11px; height: 13px; line-height: 13px; pointer-events: none; } ``` -------------------------------- ### Debug Mode Panel Sections Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Configure which sections are displayed in the Debug Mode panel. Defaults to all available sections. ```text @options: Pages Loaded | Modules Loaded | Hooks Triggered | Database Queries | Selector Queries | Timers | User | Cache | Autoload @default: all ``` -------------------------------- ### Online Editor Link Option Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Determines whether editor links should open in a live or local online editor. ```text @options: Live | Local @default: none ``` -------------------------------- ### Restrict Non-Superusers by IP Address Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specify an IP address or a PCRE regular expression to restrict access for non-superusers who have been granted the 'tracy-debugger' permission. This is highly recommended for debugging live sites. ```text @param: IP address or a PCRE regular expression ``` -------------------------------- ### Dump Variables with Tracy Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Use the dump() function to inspect variables with HTML formatting. The Debugger::dump() alternative is also available. Customize theme, nesting depth, and string length for better readability and performance. ```php $arr = [10, 20.2, true, null, 'hello']; dump($arr); // or Debugger::dump($arr); ``` ```php Debugger::$dumpTheme = 'dark'; ``` ```php Debugger::$maxDepth = 2; // default: 3 Debugger::$maxLength = 50; // default: 150 Debugger::$dumpTheme = 'dark'; // default: light ``` ```php Debugger::$showLocation = Tracy\Dumper::LOCATION_SOURCE; // Shows path to where the dump() was called Debugger::$showLocation = Tracy\Dumper::LOCATION_CLASS | Tracy\Dumper::LOCATION_LINK; // Shows both paths to the classes and link to where the dump() was called Debugger::$showLocation = false; // Hides additional location information Debugger::$showLocation = true; // Shows all additional location information ``` -------------------------------- ### Add Named Breakpoints for Performance Monitoring Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-bar.md Use `bp()` to insert named breakpoints in your code. This is useful for measuring execution time and memory usage between specific points in your application. ```php bp('A'); for($i = 0; $i < 10000000; $i++) { $a += $i; } bp('B'); sleep(2); bp('C', 'B'); for($i = 0; $i < 10000000; $i++) { $a += $i; } bp('D'); ``` -------------------------------- ### Sublime Text Editor Protocol Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specifies the protocol for opening files in Sublime Text. ```text subl://open/?url=file://%file&line=%line ``` -------------------------------- ### Configure Reserved Memory Size Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Increases the reserved memory size for Tracy's bluescreen to help prevent memory exhaustion errors. ```text @default: 500000 ``` -------------------------------- ### AI SQL Assistant Gemini Model Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Specify the Google Gemini model to use for AI-assisted SQL generation. Defaults to 'gemini-2.5-flash'. ```text @default: gemini-2.5-flash ``` -------------------------------- ### Measure Execution Time with Stopwatch Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Utilize Debugger::timer() to measure code execution time with microsecond precision. Call it without arguments to start/reset, or with a name to manage multiple timers. ```php Debugger::timer(); // sweet dreams my cherrie sleep(2); $elapsed = Debugger::timer(); // $elapsed = 2 ``` ```php Debugger::timer('page-generating'); // some code Debugger::timer('rss-generating'); // some code $rssElapsed = Debugger::timer('rss-generating'); $pageElapsed = Debugger::timer('page-generating'); ``` ```php Debugger::timer(); // runs the timer ... // some time-consuming operation echo Debugger::timer(); // elapsed time in seconds ``` -------------------------------- ### Configure Maximum Number of Items in Dumps Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the maximum number of items (elements in arrays or properties in objects) to display in dumps. ```text @default: 100 ``` -------------------------------- ### Tabs Theme Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Defines the color theme for the Console panel's tabs. Available options include Dark, Light, and Kiwi. ```ini @options: Dark | Light | Kiwi @default: Dark ``` -------------------------------- ### Log Custom Messages and Exceptions Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Use the `log()` method to record custom text messages or caught exceptions in Tracy's log. Exceptions can also trigger email notifications. ```php Debugger::log('Unexpected error'); // text message try { criticalOperation(); } catch (Exception $e) { Debugger::log($e); // log exception // or Debugger::log($e, Debugger::ERROR); // also sends an email notification } ``` -------------------------------- ### Use Native PHP Session Option Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Determines if native PHP sessions are used instead of temporary files. Recommended for resolving AJAX/Redirect bar issues, but should not be used with SessionHandlerDB. ```text @options: enabled | disabled @default: disabled ``` -------------------------------- ### Maximum Logged Requests Configuration Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the maximum number of requests to retain for each page in the Request Logger. The default is 10 requests. ```text @default: 10 ``` -------------------------------- ### Dump Variable Deeply and Widely Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Shortcut for a deeper and longer dump, useful when default limits are insufficient. Adjusts maxDepth, maxLength, and maxItems to higher values. ```php db($var, $title, $options); ``` -------------------------------- ### Configure Collapse Threshold for Top-Level Arrays/Objects Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the minimum number of items an array or object must have to be collapsed by default at the top level of a dump. ```text @default: 14 ``` -------------------------------- ### Enable Strict Mode for Error Display Source: https://github.com/adrianbj/tracydebugger/blob/master/tracy-2.12.x/readme.md Configure Tracy to display all errors or specific error levels. This is useful during development to catch all potential issues. ```php Debugger::$strictMode = true; // display all errors Debugger::$strictMode = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED; // all errors except deprecated notices ``` -------------------------------- ### Dump Variable with barDump Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Dumps a variable to a dedicated panel in the debug bar. Options for maxDepth, maxLength, and maxItems can be configured. ```php bd($var, $title, $options); /** * @param mixed $var string|array|object to be dumped * @param string $title string to identify this dump * @param array $options | maxDepth (default:3), maxLength (default:150), maxItems (default:100) * * NOTE: default maxDepth, maxLength, and maxItems are configurable in the module config settings, * but it is recommended to leave as is */ ``` -------------------------------- ### Configure Debug Bar Removal from Modals/Iframes Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Control the removal of the debug bar from specific modals and iframes for visual reasons. ```configuration @options: Regular modal | Inline modal | Overlay panels | Form Builder iframe @default: Regular modal | Inline modal | Overlay panels ``` -------------------------------- ### User Bar Background Opacity Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Sets the opacity of the user bar's background. Values range from 0 (fully transparent) to 1 (fully opaque). Defaults to 1. ```plaintext @options: 0 - 1 @default: 1 ``` -------------------------------- ### Online Editor Selection Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/configuration.md Chooses between Tracy File Editor and ProcessFileEdit for online editing. ```text @options: Tracy File Editor | ProcessFileEdit @default: Tracy File Editor ``` -------------------------------- ### Generate view links for PageArray Source: https://github.com/adrianbj/tracydebugger/blob/master/docs/debug-methods.md Renders a list of HTML links for viewing pages in a PageArray. Each link uses the page title as its label. ```php TD::viewLinks($pageArray); ```