๐Ÿ˜Ž Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Overview

Tracy - PHP debugger

Downloads this Month Tests Build Status Windows Latest Stable Version License

Introduction

Tracy library is a useful helper for everyday PHP programmers. It helps you to:

  • quickly detect and correct errors
  • log errors
  • dump variables
  • measure execution time of scripts/queries
  • see memory consumption

PHP is a perfect language for making hardly detectable errors because it gives great flexibility to programmers. Tracy\Debugger is more valuable because of that. It is an ultimate tool among the diagnostic ones. If you are meeting Tracy for the first time, believe me, your life starts to be divided into one before the Tracy and the one with her. Welcome to the good part!

Documentation can be found on the website.

Support Tracy

Do you like Tracy? Are you looking forward to the new features?

Buy me a coffee

Thank you!

Installation and requirements

The recommended way to is via Composer:

composer require tracy/tracy

Alternatively, you can download the whole package or tracy.phar file.

Tracy compatible with PHP compatible with browsers
Tracy 2.8 PHP 7.2 โ€“ 8.0 Chrome 55+, Firefox 53+, Safari 11+ and iOS Safari 11+
Tracy 2.7 PHP 7.1 โ€“ 8.0 Chrome 55+, Firefox 53+, MS Edge 16+, Safari 11+ and iOS Safari 11+
Tracy 2.6 PHP 7.1 โ€“ 8.0 Chrome 49+, Firefox 45+, MS Edge 14+, Safari 10+ and iOS Safari 10.2+
Tracy 2.5 PHP 5.4 โ€“ 7.4 Chrome 49+, Firefox 45+, MS Edge 12+, Safari 10+ and iOS Safari 10.2+
Tracy 2.4 PHP 5.4 โ€“ 7.2 Chrome 29+, Firefox 28+, IE 11+ (except AJAX), MS Edge 12+, Safari 9+ and iOS Safari 9.2+

Usage

Activating Tracy is easy. Simply add these two lines of code, preferably just after library loading (like require 'vendor/autoload.php') and before any output is sent to browser:

use Tracy\Debugger;

Debugger::enable();

The first thing you will notice on the website is a Debugger Bar.

(If you do not see anything, it means that Tracy is running in production mode. For security reasons, Tracy is visible only on localhost. You may force Tracy to run in development mode by passing the Debugger::DEVELOPMENT as the first parameter of enable() method.)

The enable() involves changing the error reporting level to E_ALL.

Debugger Bar

The Debugger Bar is a floating panel. It is displayed in the bottom right corner of a page. You can move it using the mouse. It will remember its position after the page reloading.

Debugger-Bar

You can add other useful panels to the Debugger Bar. You can find interesting ones in addons or you can create your own.

If you do not want to show Debugger Bar, set:

Debugger::$showBar = false;

Visualization of errors and exceptions

Surely, you know how PHP reports errors: there is something like this in the page source code:

<b>Parse error</b>:  syntax error, unexpected '}' in <b>HomepagePresenter.php</b> on line <b>15</b>

or uncaught exception:

<b>Fatal error</b>:  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-&gt;__call('addTest', Array)
#2 /sandbox/app/presenters/SignPresenter.php(21): App\Forms\SignFormFactory-&gt;create()
#3 /sandbox/vendor/nette/component-model/src/ComponentModel/Container.php(181): App\Presenters\SignPresenter-&gt;createComponentSignInForm('signInForm')
#4 /sandbox/vendor/nette/component-model/src/ComponentModel/Container.php(139): Nette\ComponentModel\Container-&gt;createComponent('signInForm')
#5 /sandbox/temp/cache/latte/15206b353f351f6bfca2c36cc.php(17): Nette\ComponentModel\Co in <b>/sandbox/vendor/nette/utils/src/Utils/ObjectMixin.php</b> on line <b>100</b><br />

It is not so easy to navigate through this output. If you enable Tracy, both errors and exceptions are displayed in a completely different form:

Uncaught exception rendered by Tracy

The error message literally screams. You can see a part of the source code with the highlighted line where the error occurred. A message clearly explains an error. The entire site is interactive, try it.

And you know what? Fatal errors are captured and displayed in the same way. No need to install any extension (click for live example):

Fatal error rendered by Tracy

Errors like a typo in a variable name or an attempt to open a nonexistent file generate reports of E_NOTICE or E_WARNING level. These can be easily overlooked and/or can be completely hidden in a web page graphic layout. Let Tracy manage them:

Notice rendered by Tracy

Or they may be displayed like errors:

Debugger::$strictMode = true; // display all errors
Debugger::$strictMode = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED; // all errors except deprecated notices

Notice rendered by Tracy

In order to detect misspellings when assigning to an object, we use trait Nette\SmartObject.

Content Security Policy

If your site uses Content Security Policy, you'll need to add 'nonce-<value>' to script-src and eventually the same nonce to style-src for Tracy to work properly. Some 3rd plugins may require additional directives. Avoid adding 'unsafe-inline' & 'unsafe-eval' in production mode, if you can.

Configuration example for Nette Framework:

http:
	csp:
		script-src: nonce
		style-src: nonce

Faster loading

The basic integration is straightforward, however if you have slow blocking scripts in web page, they can slow the Tracy loading. The solution is to place <?php Tracy\Debugger::renderLoader() ?> into your template before any scripts:

<!DOCTYPE html>
<html>
<head>
	<title>...<title>
	<?php Tracy\Debugger::renderLoader() ?>
	<link rel="stylesheet" href="assets/style.css">
	<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>

AJAX and redirected requests

Tracy is able to show Debug bar and Bluescreens for AJAX and redirected requests. You just have to start session before Tracy:

session_start();
Debugger::enable();

In case you use non-standard session handler, you can start Tracy immediately (in order to handle any errors), then initialize your session handler and then inform Tracy that session is ready to use via dispatch():

Debugger::enable();

// initialize session handler
session_start();

Debugger::dispatch();

Opening files in the editor

When the error page is displayed, you can click on file names and they will open in your editor with the cursor on the corresponding line. Files can also be created (action create file) or bug fixed in them (action fix it). In order to do this, you need to configure the browser and the system.

Production mode and error logging

As you can see, Tracy is quite eloquent. It is appreciated in a development environment, but on a production server, it would cause a disaster. Any debugging information cannot be listed there. Therefore Tracy has an environment autodetection and logging functionality. Instead of showing herself, Tracy stores information into a log file and shows the visitor a user-comprehensible server error message:

Server Error 500

Production output mode suppresses all debugging information which is sent out via dump() or Debugger::fireLog(), and of course all error messages generated by PHP. So, even if you forget dump($obj) in the source code, you do not have to worry about it on your production server. Nothing will be seen.

The output mode is set by the first parameter of Debugger::enable(). You can specify either a constant Debugger::PRODUCTION or Debugger::DEVELOPMENT. Other option is to set it up in a way, that development mode will be on when the application is accessed from a defined IP address with a defined value of tracy-debug cookie. The syntax used to achieve this is cookie-value@ip-address.

If it is not specified, the default value Debugger::DETECT is used. In this case, the system detects a server by IP address. The production mode is chosen if an application is accessed via a public IP address. A local IP address leads to development mode. It is not necessary to set the mode in most cases. The mode is correctly recognized when you are launching the application on your local server or in production.

In the production mode, Tracy automatically captures all errors and exceptions into a text log. Unless you specify otherwise, it will be stored in log/error.log. This error logging is extremely useful. Imagine, that all users of your application are actually betatesters. They are doing cutting-edge work for free when hunting bugs and you would be silly if you threw away their valuable reports to a recycle bin unnoticed.

If you need to log your own messages or caught exceptions, use the method log():

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
}

A directory for errors logging can be set by the second parameter of the enable() method:

Debugger::enable(Debugger::DETECT, __DIR__ . '/mylog');

If you want Tracy to log PHP errors like E_NOTICE or E_WARNING with detailed information (HTML report), set Debugger::$logSeverity:

Debugger::$logSeverity = E_NOTICE | E_WARNING;

For a real professional the error log is a crucial source of information and he or she wants to be notified about any new error immediately. Tracy helps him. She is capable of sending an email for every new error record. The variable $email identifies where to send these e-mails:

Debugger::$email = '[email protected]';

If you use the Nette Framework, you can set this and others in the configuration file.

To protect your e-mail box from flood, Tracy sends only one message and creates a file email-sent. When a developer receives the e-mail notification, he checks the log, corrects his application and deletes the email-sent monitoring file. This activates the e-mail sending again.

Variable dumping

Every debugging developer is a good friend with the function var_dump, which lists all contents of any variable in detail. Unfortunately, its output is without HTML formatting and outputs the dump into a single line of HTML code, not to mention context escaping. It is necessary to replace the var_dump with a more handy function. That is just what dump() is.

$arr = [10, 20.2, true, null, 'hello'];

dump($arr);
// or Tracy\Debugger::dump($arr);

generates the output:

dump

You can also change the nesting depth by Debugger::$maxDepth and displayed strings length by Debugger::$maxLength. Naturally, lower values accelerate Tracy rendering.

Debugger::$maxDepth = 2; // default: 7
Debugger::$maxLength = 50; // default: 150
Debugger::$dumpTheme = 'dark'; // default: light

The dump() function can display useful location information:

Debugger::$showLocation = true; // shows tooltip with path to the file, where the dump() was called, and tooltips for every dumped objects
Debugger::$showLocation = Tracy\Dumper::LOCATION_CLASS; // shows only tooltips for every dumped object containing path to the file
Debugger::$showLocation = false; // hides all location information

Very handy alternative to dump() is dumpe() (ie. dump and exit) and bdump(). This allows us to dump variables in Debugger Bar. This is useful, because dumps don't mess up the output and we can also add a title to the dump.

bdump([2, 4, 6, 8], 'even numbers up to ten');
bdump([1, 3, 5, 7, 9], 'odd numbers up to ten');

bar dump

Timing

Another useful tool is the debugger stopwatch with a precision of microseconds:

Debugger::timer();

// sweet dreams my cherrie
sleep(2);

$elapsed = Debugger::timer();
// $elapsed = 2

Multiple measurements at once can be achieved by an optional parameter.

Debugger::timer('page-generating');
// some code

Debugger::timer('rss-generating');
// some code

$rssElapsed = Debugger::timer('rss-generating');
$pageElapsed = Debugger::timer('page-generating');
Debugger::timer(); // runs the timer

... // some time-consuming operation

echo Debugger::timer(); // elapsed time in seconds

FireLogger

You cannot always send debugging information to the browser window. This applies to AJAX requests or generating XML files to output. In such cases, you can send the messages by a separate channel into FireLogger. Error, Notice and Warning levels are sent to FireLogger window automatically. It is also possible to log suppressed exceptions in running application when attention to them is important.

How to do it?

  • install extension FireLogger for Chrome
  • turn on Chrome DevTools (using Ctrl-Shift-I key) and open Console

Navigate to the demo page and you will see messages sent from PHP.

Because Tracy\Debugger communicates with FireLogger via HTTP headers, you must call the logging function before the PHP script sends anything to output. It is also possible to enable output buffering and delay the output.

use Tracy\Debugger;

Debugger::fireLog('Hello World'); // send string into FireLogger console

Debugger::fireLog($_SERVER); // or even arrays and objects

Debugger::fireLog(new Exception('Test Exception')); // or exceptions

The result looks like this:

FireLogger

Custom Logger

We can create a custom logger to log errors, uncatched exceptions, and also be called by Tracy\Debugger::log(). Logger implements the interface Tracy\ILogger.

use Tracy\ILogger;

class SlackLogger implements ILogger
{
	public function log($value, $priority = ILogger::INFO)
	{
		// sends a request to Slack
	}
}

And then we activate it:

Tracy\Debugger::setLogger(new SlackLogger);

If we use the full Nette Framework, we can set it in the NEON configuration file:

services:
	tracy.logger: SlackLogger

nginx

If Tracy does not work on nginx, it is probably misconfigured. If there is something like

try_files $uri $uri/ /index.php;

change it to

try_files $uri $uri/ /index.php$is_args$args;

Integrations

This is a list of unofficial integrations to other frameworks and CMS:

... feel free to be famous, create an integration for your favourite platform!

Comments
  • New Bar icons

    New Bar icons

    Are you open to change the bar icons? I would suggest to use Fontawesome font to generate bigger icons to look good on retina.

    My suggestions:

    Execution time: http://fontawesome.io/icon/clock-o/ Memory: http://fontawesome.io/icon/bar-chart/ Routes: http://fontawesome.io/icon/road/ Database: http://fontawesome.io/icon/database/ Identity: http://fontawesome.io/icon/user/

    I suppose, 32x32px should be enough for retina displays.

    License allows use icons without attribution, but i would suggest to mention it somewhere.

    opened by zraly 107
  • Debugger not shown on some servers with recent session changes

    Debugger not shown on some servers with recent session changes

    Since https://github.com/nette/tracy/commit/5c46e989a61fd2594db6eda0f0da4f904ccad4c7 (all the session changes) I no longer see the debugger bar on one of my servers. I haven't tested widely yet to narrow it down, but here are a few key differences between one that works and one that doesn't.

    Works: PHP 5.6.6 Server API: Apache 2.0 Handler session.save_handler: files

    Doesn't Work: PHP 5.5.35 Server API: CGI/FastCGI session.save_handler: user

    Let me know if I can provide ant further info.

    opened by adrianbj 34
  • Feature: Dump to file

    Feature: Dump to file

    In both the development and the production there is a lot of situations where "super-smart" solutions like Firelog cannot be used. Sometimes it is impossible even to get the script output to the browser, eg. non-HTTP applications like cron jobs etc.

    It would be nice to have the ability to dump variables to a file in the %tempDir%.

    API would be as follows:

    class Debugger { function fileDump($variable, $name = NULL); }
    

    This will produce Tracy's nice clickable dump saved in the %tempDir% in a HTML file optionaly with a custom name. I assume that some smart variable hash, PID and/or time prefixes could come into play.

    @dg does this a chance to be merged? Should I prepare a pull?

    opened by rostenkowski 27
  • Speed / order of loading debug bar much slower than with 2.3

    Speed / order of loading debug bar much slower than with 2.3

    This is part bug report and part feature request

    Description

    I have noticed for a while that the loading of the debug bar is quite slow. Looking through a few of my sites, it takes 2-3 seconds after the DOM has loaded before it is displayed. It also prevents any document.ready JS on the site from being applied until after the debug bar is loaded.

    The problem seems to only occur when I am loading some of my custom panels, but if I switch to the 2.3 branch of Tracy (with no other changes) the bar loads virtually immediately as the DOM finished loading. I thought it might be related to the lazy loading of panels not working anymore, but that wasn't introduced until 2.4.

    So is it possible to speed it up back to at least close 2.3 speeds, and also is it possible to load it after other JS on the page so at least if there is a delay in loading, it doesn't affect page rendering.

    Please let me know if you can't observe it at your end and I'll give you access to a site showing the problem.

    Steps To Reproduce

    Switch between 2.3 and 2.4

    opened by adrianbj 24
  • Ajax bar not working since #9dd9ebf90df

    Ajax bar not working since #9dd9ebf90df

    https://github.com/nette/tracy/commit/9dd9ebf90dff48366a0c958c5311dc42e80eef68 breaks it for me. Any thoughts on why it would have stopped working? As soon as I revert to the previous commit it works as expected.

    Thanks.

    opened by adrianbj 22
  • How to customise Error Page ?

    How to customise Error Page ?

    Hi, I seems tracy has all cool features as I am looking for, but i would like to know how can I customise error template page, I am trying to integrate with my latest project Cygnite Framework , I would like to display few information about Cygnite Framework in the Error page.

    Is it possible i can overwrite the error page, change design, color schema, project name and version etc.

    Any response would be highly appreciated.

    Thanks, Sanjoy

    opened by sanjoydesk 21
  • Change editor mapping to support multiple changes to the same substring

    Change editor mapping to support multiple changes to the same substring

    Sorry, I didnโ€™t think about the scenario of wanting make multiple changes to a substring. Of course strtr fails at this. This version allows these sorts of changes. In my scenario I can now change from the compiled version to the source version, as well as map production server URLs to the local dev source.

    Hopefully you are happy with these changes.

    opened by adrianbj 20
  • Move Tracy under namespace Nette\Tracy

    Move Tracy under namespace Nette\Tracy

    I don't think Tracy should be ashamed of to be part of Nette Framework (or being developed by Nette Foundation). If you will create more repositories with parts of Nette (e.q. Nette\Image) in future, it will be impossible to find cool names for all of them.

    In fact, I don't think it is necessary to rename Nette\Diagnostics at all :)

    opened by janmarek 20
  • Large size of live dumps in 2.6

    Large size of live dumps in 2.6

    Version: 2.6

    Bug Description

    Not sure if this is somehow specific to my implementation, but I've noticed that the size of a live dump in 2.6 is higher than 2.5. Here are some numbers to show what I mean. The tables below show the same dump once vs 100 times.

    ONCE

    | | Live ON | Live OFF | |----:|---------|----------| | 2.5 | 3.8 K | 204 K | | 2.6 | 44 K | 204 K |

    100 TIMES

    | | Live ON | Live OFF | |----:|---------|----------| | 2.5 | 276 K | Out of memory | | 2.6 | 4.6 M | Out of memory |

    So as you can see, the size of the live dump in 2.6 is significantly greater than it is in 2.5.

    Let me know if I can provide any additional info.

    Thanks.

    opened by adrianbj 18
  • bar.js won't load if current URL 404s due to apache restrictions

    bar.js won't load if current URL 404s due to apache restrictions

    Version: 2.7.3

    Bug Description

    If you visit a URL that is blocked by apache (ie before it hits PHP), eg: http://pwtest.test/hjk'k

    when there is an Apache rule like:

     RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$"
    

    preventing access to a URL with a '.

    you get the following error: GET http://pwtest.test/bla'h/?_tracy_bar=js&v=2.7.3&XDEBUG_SESSION_STOP=1 net::ERR_ABORTED 404 (Page Not Found)

    Possible Solution

    I am not sure the relevance of using <?= Helpers::escapeHtml($baseUrl) ?> here: https://github.com/nette/tracy/blob/f1d0d25de5e58749e20dacfa7973258afa230cf6/src/Tracy/Bar/assets/loader.phtml#L22

    Is there a reason the full URL to the page is needed here? If the path is changed to the root of the site, eg: http://pwtest.test/?_tracy_bar=js&v=2.7.3&XDEBUG_SESSION_STOP=1 then it loads as expected, but perhaps there is a need for the full url to the current page that I am not aware of.

    Thanks.

    opened by adrianbj 17
  • Dumper: use __debugInfo if present by default to export object

    Dumper: use __debugInfo if present by default to export object

    This is resurrection of https://github.com/nette/nette/pull/1415.

    Tests are added.

    I've also added possibility to switch this off with Dumper::DEBUGINFO => FALSE. I've chosen TRUE as default because it feels to me not only as new feature, but rather matching default behavior of PHP. Last point: I've enabled it only for PHP >=5.6 where this magic method is actually supported by PHP.

    opened by vojtech-dobes 17
  • PHP 8.2: dynamic properties are deprecated

    PHP 8.2: dynamic properties are deprecated

    Version: 2.9.5

    Bug Description

    With PHP 8.2, there is a deprecation error on dynamic properties.

    Code

    https://github.com/nette/tracy/blob/master/src/Bridges/Nette/TracyExtension.php#L120

    opened by radimvaculik 5
  • Helpers: Autodetection of PhpStorm in Linux environment for Editor URI.

    Helpers: Autodetection of PhpStorm in Linux environment for Editor URI.

    • new feature
    • BC break? yes

    In a Linux environment or on a Mac, the default disk path to PhpStorm is always /usr/local/bin/phpstorm. This allows us to detect that PhpStorm is available and set the default path to the editor.

    At the same time, on a Mac, all we have to do is set the URI and the click-through works immediately.

    This feature was inspired by the implementation in PhpStan Pro.

    Sniฬmek obrazovky 2022-05-23 vย 8 44 31

    opened by janbarasek 6
  • Huge amount of tracy sessions files

    Huge amount of tracy sessions files "tracy-*"

    DISCLAIMER : I'm aware of this ticket about setting up a custom sessionfile but my suggestion is quite different.

    I think it's more a feature than a bug, but I didn't fully understand how Tracy worked before running into this problem. And it's very problematic for the deployments of my app .... Since Tracy needs, implicitly very specific privileges.

    Brace yourself, we'll talk about sessions here.

    Here's the idea :

    1 - the acces rights of the session folder

    In the folder /var/lib/php/sessions where tracy stores its sessions files Here find an ls -la of its content, for you to get my problem.

    root@my-docker:/var/www/html# ls -la /var/lib/php/sessions
    total 28
    drwx-wx-wt 1 root     root     4096 Mar 24 13:01 .
    drwxr-xr-x 1 root     root     4096 Jun  2  2021 ..
    -rw------- 1 www-data www-data   83 Mar 24 11:07 sess_l9q9be5pija67e0criirm548ut
    -rw-r--r-- 1 www-data www-data    6 Mar 24 11:10 tracy-aef1133a02
    -rw-r--r-- 1 www-data www-data   41 Mar 24 11:07 tracy-afea481a37
    -rw-r--r-- 1 www-data www-data   23 Mar 24 13:01 tracy-c2f9802a62
    -rw-r--r-- 1 www-data www-data   23 Mar 24 13:01 tracy-ddce050766
    

    My app is connected as www-data.

    2 - the FileSession.php class

    I understood that this class handle the session file. Moreover the clean() function allows Tracy to delete its sessions files. OK

    3 - The problem with my environment

    On the example above I listed only 4 "tracy-" sessions files but after few hours (since I check the 'heartbeat' of my test servers by calling the index) I can end up with thousands of useless tracy files.

    The incriminated line is here officer : https://github.com/nette/tracy/blob/e4dd63c60b69cfaa68aac874abf8f456837858ed/src/Tracy/Session/FileSession.php#L84

    The problem with the function glob is that you need to have access rights on the folder sessions as it needs to list all files in the folder. But you can see up there with my ls -la that my folder has very limited rights. (i.e. I can't list the files in the folder but I can delete them if I know the precise filenames.)

    4 - Possible improvement

    Usually a normal development environment never connects as root, so it may be problematic for devs like me.
    I don't have the rights to list all files but I can delete/modify files as long as I know their names.

    Here's the idea : add an attribute to FileSession typed string[] to list all the session files created to unlink all the name listed in this variable, instead of using glob.

    This feature would be consistent with the way session_destroy() works.
    Php lists all the created file like a zval then deletes them by listing all the registered names instead of listing all the session file names from the folder.

    opened by DanielC-N 1
  • psr3 adapter for monolog/monolog example

    psr3 adapter for monolog/monolog example

    I tested with the following code:

    index.php

    <?PHP
    use Tracy\ILogger;
    use Tracy\Debugger;
    use Tracy\Bridges\Psr\PsrToTracyLoggerAdapter;
    use Monolog\Logger;
    use Monolog\Handler\StreamHandler;
    
    require_once "vendor/autoload.php";
    
    $monolog = new Logger('main-channel');
    $monolog->pushHandler(new StreamHandler("/private/tmp/ok/lol.log", Logger::DEBUG));
    
    $tracyLogger = new PsrToTracyLoggerAdapter($monolog);
    Debugger::setLogger($tracyLogger);
    Debugger::enable();
    
    Debugger::log("info");
    Debugger::log('warning', ILogger::WARNING);
    

    composer.json

    {
        "name": "paxperscientiam/ok",
        "require-dev": {
            "tracy/tracy": "^2.9",
            "monolog/monolog": "^2.3"
        },
        "autoload": {
            "psr-4": {
                "Paxperscientiam\\Ok\\": "src/"
            }
        },
        "authors": [
            {
                "name": "Chris",
                "email": "[email protected]"
            }
        ],
        "require": {}
    }
    
    • bug fix / new feature?
    • BC break? yes/no
    • doc PR: nette/docs#???
    opened by paxperscientiam 2
  • White Screen after upgrade

    White Screen after upgrade

    Version: 2.9.1

    Bug Description

    Would get a White Screen of Death with 2.9.1. Could not find any errors in my log or on the screen.

    Steps To Reproduce

    Commented out lines until I get 2.9.1 to work to some degree by removing the dispatch function from Debugger.php

    I saw this in the release notes Debugger: enable() calls dispatch() always I think it is my problem.

    Possible Solution

    I changed my composer.json to hold at 2.9 and everything is fine.

    opened by masonjo 2
Releases(v2.9.5)
  • v2.9.5(Nov 18, 2022)

    • support for PHP 8.2
    • tableSort: sort using a natural order algorithm (#547)
    • BlueScreen: scroll to top when visible
    • BlueScreen: fixed initialization issues, added globalInit()
    • BlueScreen: toggler is visibile in quirks mode
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(73.47 KB)
  • v2.9.4(Jul 19, 2022)

  • v2.9.3(May 30, 2022)

  • v2.9.2(Apr 27, 2022)

    • added support for Generator & Fiber
    • BlueScreen: added column highlighting
    • Logs exception if the Content-Length header prevents the Bar from being displayed #255
    • Unlock session file before close #540
    • better detection of HTML mode
    • BlueScreen: closes </code>
    • Dumper: disabled HASH disables "see above/see below"
    • DeferredContent::sendAssets() uses Content-Length to prevent further output
    • Helpers: improved color detection
    • Describer: $maxDepth returned to value 7
    • css tweaks, resets property 'display'

    https://user-images.githubusercontent.com/194960/165589851-7099d7e7-202d-4c95-9391-aae59ec2b650.mp4

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(73.28 KB)
  • v2.9.1(Feb 15, 2022)

    • reset.css uses custom tag <tracy-div> to reduce specificity below class specificity
    • BlueScreen: is wrapped in <tracy-div>, uses CSS reset instead of disabling stylesheets and all classes are prefixed with 'tracy-' #533
    • dump() is wrapped in <tracy-div> to use CSS reset
    • Dumper: default $maxDepth increased to 15
    • Debugger, TracyExtension: added $maxItems and option 'maxItems' #531
    • Debugger: enable() calls dispatch() always
    • Bluescreen: sticky footer
    • Dumper: bold class names
    • Debugger: is_dir can trigger warning #527
    • TracyExtension: $editor accepts null
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(71.31 KB)
  • v2.7.9(Feb 15, 2022)

    This is the last 2.7.x release.

    • Debugger: don't render bar after dispatching assets
    • bluescreen.css: fixed flash of black text
    • Compatibility with psr/log ^2.0 and ^3.0 (#508)
    • BlueScreen: used scrubber for HTTP response headers (#513)
    • BlueScreen: used scrubber for HTTP headers (#498)
    • Revert "Bluescreen: added length limit for exception message (#383)" for $title
    Source code(tar.gz)
    Source code(zip)
  • v2.6.8(May 17, 2020)

  • v2.5.9(May 17, 2020)

  • v2.9.0(Dec 21, 2021)

    • BlueScreen redesign:
      • new callstack
      • added tabs to Environment & HTTP
      • added tabs with Latte template (source mapping)
    • works without session
    • TracyExtension: allow to specify error level for scream and strictMode, improve supported error level expressions
    • Debugger: allow to specify error severity in $scream
    • big refactoring
    • Debugger::errorHandler() always returns false to fill-in error_get_last(), 'display_errors' disabled
    • Debugger::dispatch() is not starting session automatically
    • BlueScreen: creates new file with content

    https://user-images.githubusercontent.com/194960/146819835-f40a7f90-3660-4bfa-af88-1ba15bac1153.mp4

    https://user-images.githubusercontent.com/194960/146982933-7f6e3c87-5165-41d2-a6ef-7cc1830316c8.mp4

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(70.71 KB)
  • v2.8.10(Dec 21, 2021)

  • v2.8.9(Nov 24, 2021)

    • Helpers::editorLink() improved file name truncation
    • Bridge: compatibility with new Latte & Neon
    • BlueScreen: added output buffer status
    • BlueScreen: added info about sent headers
    • BlueScreen: warning about last muted error
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(61.22 KB)
  • v2.8.8(Nov 8, 2021)

    • TracyExtension: added option 'emailSnooze' #515
    • unified detection of CLI mode #516
    • Helpers::encodeString() prints special unicode characters as \u{...}
    • added option Dumper::HASH
    • Debugger: added FireLogger to preload #514
    • BlueScreen: used scrubber for HTTP response headers (#513)
    • Compatibility with psr/log ^2.0 and ^3.0 (#508)
    • BlueScreen: don't create empty 'Variables'
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(60.90 KB)
  • v2.8.7(Aug 16, 2021)

    • supports PHP 8.1
    • solves the circular reference of previous exceptions #499
    • BlueScreen: used scrubber for HTTP headers (#498)
    • Debugger: improved error in CLI
    • class_exists() it won't trigger autoloading because it may not work #497
    • Debugger: updated list of preloaded classes
    • Debugger: render code snipet in CLI on error (#494)(#490)
    • BlueScreen: fixes displaying "\r\n" and "\t" in exception's message #492
    • BlueScreen: fixed header when message is empty (after aff47f2b6)
    • Dumper: support for enums
    • added Debugger::$keysToHide
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(60.72 KB)
  • v2.8.5(Jun 2, 2021)

  • v2.8.4(Apr 27, 2021)

    • Dumper: $maxDepth & $maxItems = 0 means no limit
    • Dumper: scrubber checks also non-string keys (#473)
    • Debugger: apply editor mapping for browser from CLI (#477)
    • Helpers::improveException() ignores Nette\MemberAccessException #479
    • bluescreen: removed unused 'object' from callstack #480
    • dumper: fixed first line indentation #475
    • Bluescreen: Add selection color (#471)
    • BlueScreen::formatMessage() don't highlight \n
    • BlueScreen: previous exception messages are formatted
    • open-editor.js: added Visual Studio Code/VS Codium (#464)
    • Bar: fixed [redirect|ajax] css #463
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(69.70 KB)
  • v2.7.8(Apr 27, 2021)

    • Helpers::improveException() ignores Nette\MemberAccessException #479
    • Debugger: apply editor mapping for browser from CLI (#477)
    • Helpers: workaround for PHP 8.0.0 bug #80564
    • Helpers: xdebug_get_function_stack() may trigger warning
    • bluescreen: removed unused 'object' from callstack #480
    • js: prevents double initialization
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(61.11 KB)
  • v2.8.3(Jan 31, 2021)

  • v2.8.2(Jan 21, 2021)

    • dumper: prevent escaped sequences from being copied #458
    • Renderer: ini_set may be disabled #457
    • toggle.css: new graphic and animated caret
    • dumper: more conservative expanding of collapsed structures
    • bluescreen: bold class/method/function
    • bluescreen: improved listing of variadics arguments
    • BlueScreen: whole vendor is not added to collapsePaths, only tracy/ nette/ latte/
    • Debugger::$maxDepth changed to 7 (#456)
    • Debugger::dump() fixed return mode in CLI
    • bar.css: synced with dumper.css
    • bluescreen: added REQUEST_METHOD

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(59.91 KB)
  • v2.8.1(Jan 1, 2021)

    • Toggle: Alt-click to toggle all child nodes recursively
    • Dumper: fixed string coloring in CLI
    • Dumper: added guide lines for multiline strings [Closes #453]
    • Dumper: color differentiation of quotation marks around strings
    • Dumper: added togglers for multiline strings
    • Dumper: indentation lines in arrays are visible when value is multiline strings
    • BlueScreen: changed $maxDepth to 5, added $snapshot to keysToHide
    • Dumper: keysToHide can contain class names, ie 'Class::$proName'
    • Dumper: declaring class name passed to scrubber; also ignores special types
    • Dumper: fixed displaying of too big integers in JS [Closes #454]
    • Dumper: removed last \n from strings
    • Dumper: render tab as 4 spaces
    • Helpers: workaround for PHP 8.0.0 bug #80564
    • Helpers: xdebug_get_function_stack() may trigger warning
    • TracyExtension: added $keyToHide
    • TracyExtension: fixed compatibility with nette/di < 3.0.3
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(59.47 KB)
  • v2.8.0(Dec 10, 2020)

    requires PHP 7.2

    Completely Redesigned Dumper

    image

    • added themes 'light' & 'dark'
    • added background for light scheme
    • in CLI outputs to STDOUT to bypass output buffering
    • implemented Scrubber (#439)
    • default maxDepth changed to 7
    • improved dumping of PHP Incomplete Class, DOM, ArrayObject, closures
    • shows uninitialized properties [Closes #448]
    • added 'see below', 'see above'
    • added tooltips about Ctrl-click
    • redesigned source location link ๐Ÿ“
    • clever way of displaying strings and escaped sequences, length is in tooltip in bytes or unicode characters
    • strings are quoted in single quotes
    • shows declaring class of private properties as tooltip
    • added option to limit max items in array/objects
    • added hover effect for guide lines
    • changed '=>' to ':' as key separator for objects & resources
    • distinguishes virtual property, resources are virtual
    • shows 'pub' to distinguish between public and dynamic properties
    • hash highlighting on mouseover
    • dumps zval references

    Other Improvements

    • open-editor.sh: opening from Tracy in PHPStorm for Linux users (#447)
    • install.cmd: workaround for Chrome >= 77
    • Bar: sends content in UTF-8
    • TracyExtension: configures Tracy only when is enabled
    • Helpers::detectColors() supports https://no-color.org & sapi_windows_vt100_support
    Source code(tar.gz)
    Source code(zip)
    tracy.phar(58.23 KB)
  • v2.7.7(Dec 16, 2020)

  • v2.7.6(Nov 2, 2020)

    • compatible with PHP 8.0
    • Bar: added info about JIT (#440)
    • BlueScreen: phpinfo() returns text in CLI #444
    • BlueScreen: Allow to hide environment section by default (#438)
    • bluescreen.css: improved editor links color & background #443
    • BlueScreen: unified listing of hidden keys #441
    • Helpers::getSuggestion: item may be an int, type cast fix
    • Debugger: workaround for PHP bug #80234
    • TableSort: order can be specified by attribute data-order #442
    • BlueScreen: fixed error when file not exists #428
    • bar.js: fixed escaping
    • Dumper: fixed strict type #422

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(51.55 KB)
  • v2.7.5(May 17, 2020)

    • bar: sends content in UTF-8
    • bar.js: fetch checks Response (#420)
    • bar: escapes <!-- in <script> #421
    • Dumper: supports closed resource
    • bar: fixed table sort after 193740e
    • Toggle: detects mouse click vs drag
    • Dumper: class names are selectable
    • Debugger: disables zend.exception_ignore_args #415
    • .phpstorm.meta: added exit point
    • Revert "Info panel: Add server name by IP (#401)" #416 #417

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(51.04 KB)
  • v2.7.4(Apr 11, 2020)

    • BlueScreen::formatMessage() clickable methods & files
    • BlueScreen::highlightPhp() removed part of code after __halt_compiler()
    • Revert "Dumper: changed detection of recursive arrays, marker changed to strict comparison"
    • Debugger::exceptionHandler() evaluates template in closure
    • Debugger::exceptionHandler() sends Content-Type only when needed
    • Logger & MailSender: replaced HTTP_HOST with SERVER_NAME #309
    • TableSort: better support for thead #348
    • Helpers::guessClassFile() fixed
    • BlueScreen: do not show Enviroment on 'Allowed memory size of *** bytes exhausted'
    • BlueScreen: refactoring, added formatMessage()
    • TracyExtension: fixed config schema #409
    • Dumper: quotes keys true|false|null
    • Info panel: Better detection server IP and server name. (#406)

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(51.42 KB)
  • v2.6.7(Apr 11, 2020)

    • Revert "Dumper: changed detection of recursive arrays, marker changed to strict comparison"
    • Logger & MailSender: replaced HTTP_HOST with SERVER_NAME #309
    • TableSort: better support for thead #348
    • Helpers::guessClassFile() fixed
    • BlueScreen::highlightPhp() removed part of code after __halt_compiler()
    • BlueScreen: do not show Enviroment on 'Allowed memory size of *** bytes exhausted'
    • some fixes

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(50.54 KB)
  • v2.7.3(Feb 23, 2020)

    • Info panel: Add server name by IP (#401)
    • Bluescreen: opens link to new window (#400)
    • TracyExtension: uses $initialization
    • dumper.js: fixed detection of recursion
    • BlueScreen: clickable classes in exception message
    • bar.css: better hiding of panel icons
    • TracyExtension: email accept array (#395)
    • readme: synced with documentation

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(50.46 KB)
  • v2.6.6(Jan 2, 2020)

    • Debugger: fixed compatibility with PHP 7.4
    • Debugger::errorHandler correctly fill-in error_get_last() when $logSeverity is used
    • dumper.js: fixed detection of recursion
    • bar.js: stopImmediatePropagation after opening/closing tab
    • FireLogger: added space in header
    • content.phtml: fixed headers in format 'A:B'

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(49.73 KB)
  • v2.7.2(Dec 15, 2019)

    • Bar: added info [redirect|ajax] to panel headers
    • bar.js: stopImmediatePropagation after opening/closing tab
    • Debugger: fixed compatibility with PHP 7.4
    • Debugger: implemented support for E_COMPILE_WARNING
    • Debugger::errorHandler correctly fill-in error_get_last() when $logSeverity is used
    • refactoring, removed parameter $exit from exceptionHandler()
    • Debugger::exceptionHandler() when connection is aborted, log exception
    • FireLogger: added space in header
    • content.phtml: fixed headers in format 'A:B'
    • TracyExtension: editorMapping is null by default (#393)
    • Safe output capturing via Helpers::capture()

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(50.25 KB)
  • v2.7.1(Nov 2, 2019)

  • v2.7.0(Sep 24, 2019)

    • Logger: added priority to the exception file name
    • TracyExtension: added getConfigSchema()
    • Dumper: hidden values are rendered with variable's type [Closes #380]
    • InfoPanel: Add information about localhost IP
    • Bluescreen: added length limit for exception message (#383)
    • BlueScreen: removed source from footer
    • Bluescreen: footer is always on bottom
    • bar: replaced attribute 'rel' with 'data-tracy-action' for closing & open-to-window links
    • tested against PHP 7.4

    For the details you can have a look at the diff.

    Source code(tar.gz)
    Source code(zip)
    tracy.phar(50.01 KB)
Owner
Nette Foundation
Nette Foundation
Slim Framework Tracy Debugger Bar

Slim Framework Tracy Debugger Bar configure it by mouse now in package: Panel Description Slim Framework - Slim Environment RAW data Slim Container RA

null 72 Aug 29, 2022
PHP errors for cool kids

whoops PHP errors for cool kids whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debu

Filipe Dobreira 12.9k Dec 24, 2022
Low-overhead sampling profiler for PHP 7+

phpspy phpspy is a low-overhead sampling profiler for PHP. For now, it works with Linux 3.2+ x86_64 non-ZTS PHP 7.0+ with CLI, Apache, and FPM SAPIs.

Adam 1.3k Dec 24, 2022
Silex Web Profiler

The Silex Web Profiler service provider allows you to use the wonderful Symfony web debug toolbar and the Symfony profiler in your Silex 2.x application.

Silex 209 Dec 5, 2022
Kint - a powerful and modern PHP debugging tool.

Kint - debugging helper for PHP developers What am I looking at? At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug

null 2.7k Dec 25, 2022
The ultimate debugging and development tool for ProcessWire

Tracy Debugger for ProcessWire The ultimate โ€œswiss army knifeโ€ debugging and development tool for the ProcessWire CMF/CMS Integrates and extends Nette

Adrian Jones 80 Oct 5, 2022
Xdebug โ€” Step Debugger and Debugging Aid for PHP

Xdebug Xdebug is a debugging tool for PHP. It provides step-debugging and a whole range of development aids, such as stack traces, a code profiler, fe

Xdebug 2.8k Jan 3, 2023
Sage - Insightful PHP debugging assistant โ˜ฏ

Sage - Insightful PHP debugging assistant โ˜ฏ At first glance Sage is just a pretty replacement for var_dump() and debug_backtrace(). However, it's much

null 27 Dec 26, 2022
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.

A server for debugging more than just Laravel applications. Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps d

Buggregator 311 Jan 4, 2023
A collection of helper methods for testing and debugging API endpoints.

Laravel API Test Helpers This is a collection of helper methods for testing and debugging API endpoints. Installation You can install the package via

Stephen Jude 49 Jul 26, 2022
WordPress debugging made simple.

Loginator Debugging WordPress can sometimes be a pain, our goal is to make it easy, which is why Loginator was built with this in mind. From creating

Poly Plugins 2 Feb 12, 2022
Restart a CLI process without loading the xdebug extension.

composer/xdebug-handler Restart a CLI process without loading the Xdebug extension, unless xdebug.mode=off. Originally written as part of composer/com

Composer 2.4k Dec 30, 2022
A tool to profile mysql queries in php env.

MysqlQueryProfiler This tool helps you to quickly profile a mysql query in a PHP 7.4+ environnement. You can also compare 2 queries. This image shows

null 8 Jul 30, 2021
Handle PHP errors, dump variables, execute PHP code remotely in Google Chrome

PHP Console server library PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things u

Sergey 1.4k Dec 25, 2022
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source lib to make a debug in php direct in terminal, without necessary configure an IDE. Th

Renato Cassino 190 Dec 3, 2022
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source library that allows a developer to debug in php direct in terminal, without necessary

Renato Cassino 190 Dec 3, 2022
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function that you can use instead of var_dump().

VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t

Symfony 7.1k Jan 1, 2023
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.

RayServer is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app. It runs without installation on multiple platforms.

Pavel Buchnev 310 Jan 2, 2023
PHP APM (Alternative PHP Monitor)

APM (Alternative PHP Monitor) APM (Alternative PHP Monitor) is a monitoring extension enabling native Application Performance Management (APM) for PHP

Patrick Allaert 310 Dec 4, 2022