Tracy: the standalone version of Nette Debugger

1. about a year ago

David Grudl
Administrator
Registered: 2005-02-08
Posts: 5673

Tracy: the standalone version of Nette Debugger

After five years of development, here is a really standalone version of tool you know very well as:

  • Laděnka
  • Nette Debug
  • Nette Debugger
  • Nette Diagnostics

And now it is called Tracy.

Currently, Tracy has the same API as Nette\Diagnostics (only namespace was changed). But I think this is chance to take a step in the development and find much better API. Any ideas?

 

2. about a year ago

echo
Member
Registered: 2010-09-28
Posts: 90

Re: Tracy: the standalone version of Nette Debugger

David Grudl wrote:

And now it is called Tracy.

Currently, Tracy has the same API as Nette\Diagnostics (only namespace was changed). But I think this is chance to take a step in the development and find much better API. Any ideas?

Wouldn't it be better then if Nette was using Tracy rather than Nette\Diagnostics as there would be no duplicities when updating either source (Nette master/Tracy master)? In my opinion both should be identical. Or not?

 

3. about a year ago

martinit
Member
Registered: 2012-04-25
Posts: 366

Re: Tracy: the standalone version of Nette Debugger

I think that echo has right.

This is not good idea. One app in two different namespaces.


Stop using __constructor() in presenters! Use @inject annotation or function inject<Name>(Name $a) {…}

 

4. about a year ago

Majkl578
Moderator
Registered: 2009-05-02
Location: Praha
Posts: 1227

Re: Tracy: the standalone version of Nette Debugger

Nette itself should require/suggest Tracy in composer.json and remove Nette\Diagnostics.


Debian experimental x86_64 (kernel 3.14), Gnome 3.12, PHP 5.5 FPM + nginx + PostgreSQL + MySQL


“There are 10 types of people in this world. Those who understand binary and those who don't.”

 

5. about a year ago

Filip Procházka
Moderator
Registered: 2009-06-01
Location: Brno
Posts: 4035

Re: Tracy: the standalone version of Nette Debugger

I agree, It can be added to dev and Nette could have BC aliases in itself.

 

6. about a year ago

martinit
Member
Registered: 2012-04-25
Posts: 366

Re: Tracy: the standalone version of Nette Debugger

@Filip Procházka: But I think that if replace Nette\Diagnostic with Tracy (over composer) will be in 2.1 … you can skip alliases


Stop using __constructor() in presenters! Use @inject annotation or function inject<Name>(Name $a) {…}

 

7. about a year ago

Filip Procházka
Moderator
Registered: 2009-06-01
Location: Brno
Posts: 4035

Re: Tracy: the standalone version of Nette Debugger

Better BC = happier users.

 

8. about a year ago

martinit
Member
Registered: 2012-04-25
Posts: 366

Re: Tracy: the standalone version of Nette Debugger

@Filip Procházka: That sounds like a good idea ;)


Stop using __constructor() in presenters! Use @inject annotation or function inject<Name>(Name $a) {…}

 

9. about a year ago

Milo
Moderator
Registered: 2010-05-04
Posts: 736

Re: Tracy: the standalone version of Nette Debugger

This is not an idea to API change, but idea for manual libs loading.

Tracy.php // loader + shortcuts
Tracy.no-shortcuts.php // loader

I have never met with naming conflict pesonally, I use only Tracy ;-), but it seems to me as a nice harmless way to disable shortcuts.

 

10. about a year ago

Milo
Moderator
Registered: 2010-05-04
Posts: 736

Re: Tracy: the standalone version of Nette Debugger

And add one more shortcut:

function bdump($var)
{
    Tracy\Debugger::barDump(func_get_args());
}

 

11. about a year ago

David Grudl
Administrator
Registered: 2005-02-08
Posts: 5673

Re: Tracy: the standalone version of Nette Debugger

Tracy should be compatible with Composer autoloading, so there should be something like Tracy\Shortcuts::init().

 

12. about a year ago

Milo
Moderator
Registered: 2010-05-04
Posts: 736

Re: Tracy: the standalone version of Nette Debugger

To the API change topic… I would appreciate these changes.

  1. Convert static classes to singletons. For Dumper and Debugger at least. In my code is often Debugger::log($e), in better cases $this->logger->log($e) where:
class ErrorLogger {
    public function log(...) {
        Tracy\Debugger::log(...);
    }
}
  1. Provide mechanism to object dumping. E.g. Dumper::forObject('Milo\Class', function($dumper) {...}).
  2. Provide mechanism to easiest Dumper or Debugger configuration. This is my often usage:
Tracy\Debugger::enable(...);
Tracy\Debugger::$strictMode = TRUE;
Tracy\Debugger::$maxDepth = 1e5;
// and configure Dumper::COLLAPSE_COUNT is very hard

// Fluent may be helpful
Tracy\Debugger::configure()->enable(TRUE)->email(...)->getDumper()->maxDepth(10);
  1. Somehow remember which object/class members should stay collapsed or expanded. Or mark them as non-dumpable. It is very useful for big structures where is a little bit annoying still clicking after every dump. I have no concrete idea how to do it. Perhaps over JavaScript and cookie
this.collapsed['Milo\Class::member'] = TRUE;
  1. Provide interface to logging on non-stdout. Useful during XML-RPC debugging where FireBug does not exists. I have a SqliteDebugger where I fill dumps and by AJAX dumping them into browser. Somehow easy redirect whole BlueScreen/dumps html would be great.
  2. Possibility to continue after Warning/Notice in strictMode, just like PHP itself.

These are things which I find useful to have. I'm sure that some of issues can be solved in other way I proposed, it is just idea.

 

13. about a year ago

enumag
Member
Registered: 2012-10-11
Location: Praha
Posts: 1676

Re: Tracy: the standalone version of Nette Debugger

Somehow remember which object/class members should stay collapsed or expanded. Or mark them as non-dumpable. It is very useful for big structures where is a little bit annoying still clicking after every dump. I have no concrete idea how to do it. Perhaps over JavaScript and cookie

Marking as non-dumpable would be good. I often get very large dumps because some large structures are dumped on multiple levels of the backtrace. The bluescreen rendering then takes VERY long time and the structures that caused it were pretty much useless for finding the error. I'd be glad to get rid of them.

 

Board footer

Switch to desktop