Jump to content

Tracy Debugger


adrian

Recommended Posts

1 hour ago, adrian said:

Hope you guys find these new additions useful!

Yes, definitely :) We cannot thank you enough for this module, but at least we need to try! Anyway, the even stronger support of ajax debugging came just the right time for me, as I am about to start a new project utilizing lots of ajax magic.

  • Like 2
Link to comment
Share on other sites

On 1/4/2017 at 5:28 AM, tpr said:

How about adding a link to the Tracy module settings page to the Panel selector panel?

@tpr - I happy to do that, but just wondering if you noticed the link to the settings from the first row of icons on the ProcessWire Info panel? Maybe you don't have that enabled by default?

Link to comment
Share on other sites

Yes, I don't have that panel enabled. I use the Panel selector and occassionally enable the panel I need (Console, Validator). It's maybe only me but the Panel Selector is the "Control Panel" of TD :) I could imagine double-clicking on the "Tracy" icon to go to the module settings page.

  • Like 1
Link to comment
Share on other sites

3 hours ago, tpr said:

Yes, I don't have that panel enabled. I use the Panel selector and occassionally enable the panel I need (Console, Validator). It's maybe only me but the Panel Selector is the "Control Panel" of TD :) I could imagine double-clicking on the "Tracy" icon to go to the module settings page.

Ok, here's a screenshot showing the tooltip that indicates double-clicking the "Tracy" icon opens the module settings.

Screen-Shot-2017-01-05-at-12.20.47-PM.png

Currently it opens the module settings in a different tab. I am not usually a fan of this, but in this case where we are using double-click and there is no way to user initiate a new tab, I think this is best for now.

I'll commit along with the new console history/snippets stuff - hopefully shortly ;) 

  • Like 4
Link to comment
Share on other sites

The Console Panel now has a History stack and a separate Snippets stack!

Hi everyone - this has been a long time coming. It was originally suggested by @bernhard back in early November.

I want to thank @bernhard for the idea and feedback on draft versions, and @tpr who has contributed many ideas, style suggestions, and code to this functionality - sincere thanks to both of you!

Screen Shot 2017-01-05 at 10.53.52 PM.png

 

Snippets 

  • are automatically saved to the tracy config settings entry in the modules database table so that they are available on other browsers/computers
  • have a dedicated save button - they are not saved automatically when running code
  • save button only available when loaded snippet code is different from saved version so you know whether you have made changes
  • has the ability to sort alphabetically or chronologically (date modified)
  • no limit of number of snippets stored
  • snippets can be deleted - a icon appears when you mouseover a snippet in the list

History 

  • items are saved to local storage
  • automatically saved when you "run" code
  • comes with "Back" and "Forward" arrows for moving between history items
  • currently stores maximum of 25 items - let me know if you think this needs adjusting

 

Some other miscellaneous changes

  • when running code, output is now appended to the results panel (like your browser dev console)
  • you can used ALT/OPT+Enter keyboard shortcut to Clear and Run
  • the "Clear" button now clears the results panel, but leaves the code intact

 

Future ideas

  • ability to easily export/import snippets to stack
  • your ideas :)


Please let me know if you come across any bugs or weirdness with anything - it's still pretty early stages!

  • Like 6
Link to comment
Share on other sites

Quick update to the Strict Mode and AJAX calls. I just added a new config setting that allows you to turn on Strict Mode for just AJAX calls. This is helpful if you want to know for certain that an AJAX call returned a failure. Remember that Tracy intercepts Notices and Warnings and displays them in the Errors panel. As I mentioned a little while back this can result in an AJAX call being successful when Tracy is running, but failing when it's not because the notice/warning breaks the AJAX response.

This new option will be good if you're not sure you'll pay attention to the red alert in the Errors panel.

  • Like 1
Link to comment
Share on other sites

Hi @adrian

For first time, I have a problem with this module, version 3.6.0.

 Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

I tried de-install/re-install but without success.

 

Link to comment
Share on other sites

Just now, mel47 said:

Hi @adrian

For first time, I have a problem with this module, version 3.6.0.


 Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

I tried de-install/re-install but without success.

 

Try rolling back your PW version to 3.0.47 - https://github.com/processwire/processwire-issues/issues/151

  • Like 1
Link to comment
Share on other sites

I can confirm this error too.

7 hours ago, adrian said:

Fatal error: Call to undefined function wire() in /multimedia/sites/dev-wire/site/assets/cache/FileCompiler/site/modules/TracyDebugger/ProcesswireLogsPanel.inc on line 72

 

Link to comment
Share on other sites

  • 2 weeks later...

@adrian The tracy debug bar takes up a lot of screen real estate, how about adding an option for collapsing the tracy debug bar by default into a "Debug" toggle link that shows fixed in the bottom right hand corner?

When a user clicks the "Debug" link, it would show the entire bar.

Currently a user has to refresh the whole page to bring back the toolbar if a user click's the "x" to close the toolbar.  With a toggle link it can appear or disappear.

Just a thought..

  • Like 1
Link to comment
Share on other sites

@gmclelland - have you tried unchecking "Show Panel Labels" ? I do that on all my sites. The only reason I have it on by default is for new users so it's easier to know what the panel icons are.

If that's still not enough, I'll have a think about the hide toggle for you. 

Link to comment
Share on other sites

@gmclelland - I decided to go ahead with adding this anyway :)

The latest version replaces the existing close (x) button with a hide arrow.

Screen Shot 2017-01-17 at 9.13.06 PM.png

This is what it looks like when hidden:

Screen Shot 2017-01-17 at 9.14.32 PM.png

In case anyone is wondering, this is quite different to the Enable/Disable button (either from the dedicated panel, or from the panel selector) because with this new option, even when hidden it is still capturing errors etc and when you unhide/show it will instantly show it's information without the need for a page reload.

There is also a new module config setting to "Hide Debug Bar By Default". That should be self-explanatory, but keep in mind that once you have clicked on the show or hide buttons, cookies take over controlling its status.

Please let me know if you have any problems.

Just an FYI - I am not a big fan of this because you won't be alerted about non-fatal warnings/notices while the debug bar is hidden, but I think it's nice to give users the option if they prefer it.

  • Like 4
Link to comment
Share on other sites

Just an idea: how about making it three-state, eg full-nolabel-min?

I also think the new setting to hide the bar is not needed, and perhaps the hide label setting is also superfluous if my suggestion gets accepted.

Link to comment
Share on other sites

44 minutes ago, tpr said:

Just an idea: how about making it three-state, eg full-nolabel-min?

I also think the new setting to hide the bar is not needed, and perhaps the hide label setting is also superfluous if my suggestion gets accepted.

Thanks for your ideas on this. I must admit though that I never have a need for the labels to be displayed (I actually think they look horribly ugly), so I am not convinced about the three-state toggle, but I am open to being convinced if enough people would like it.

I probably agree with you regarding not needing  the new setting to hide bar by default - I added it anyway, just in case it's easier with very small touch screens where it might be hard to hide in the first place - maybe not really that hard?

On another note, I just committed another update which adds nicer/simpler exception reporting for the Console panel. I was getting tired of the Tracy "Bluescreen" showing the full stack trace for a simple syntax error in the console. I wonder if at times my changes might hide useful info though, so I'll keep an eye on things and maybe add an checkbox option to turn on the full trace if checked. Please let me know how you find this new approach.

  • Like 2
Link to comment
Share on other sites

FYI - that last change regarding exception handling in the Console panel only seems to be working here on PHP 7 - on PHP 5 it reverts to the full stack trace result.

Not sure if I overlooked something or what just yet, but if anyone feels like testing a simple syntax error in different environments and let me know what happens, that would be appreciated. Thanks!

  • Like 1
Link to comment
Share on other sites

Thanks - just tried the Hide button and I feel that it should have some extra space around, eg.

padding: 0 3px 0 5px;

Plus I think it would look nicer to have the module icon (the bug) instead of the arrow. You could play with opacity to distinguish its on/off state.

  • Like 1
Link to comment
Share on other sites

Hi everyone - Absolute newbie question (I'm discovering the module and actually I'm also discovering PHP debug stuff, so sorry if my question is rather stupid)

I've just installed the module and it loads fine on my localhost with the bottom bar. If I look at the 'Processwire Debug Mode' (which I've set ON in my config.php), I see many infos such as 'Pages loaded', 'API Variables', 'Session'... with numbers. I'm very interested since I have a page which loads 4991 pages and so takes quite a long time (and I'm desperately trying to optimize it), BUT, and here's my problem : if I click on the link to see the pages, the menu drops down (cool!) but it triggers a page load which in its turn redirects immediately to my 404 error page... and I lose the current information :(

I am spending quite a while trying to understand how to dive into this PHP debug tool (I have to admit it's for the moment way over my coder's skills), but here, I'm a little stuck on what seems to be... not much. So if anyone can give me hint on that one, I'd appreciate. Thanks !

PS : Maybe I should have opened a new question in the forum rather than following this topic ?

Link to comment
Share on other sites

@kongondo : I was definitely thinking of starting a new topic and ask you, guys, about my optimisation issue, but I wanted to find some clues by myself first... and believe me, I am trying to find something (hence my discovering of TracyDebugger :) ) but at the moment, I stay also curious about why I have to load 5000 pages ! (Except I am the creator of these pages, so this is rather shameful...)

So I'll start a new topic soon ! But I still think the expected behavior of my TracyDebugger shouldn't be to redirect me when I click on the 'Pages loaded' link, no?

 

Edit : WHile I'm at it, the 'Show bar in backend' option is NOT ticked and the bar displays in backend anayway :( And it triggers the 'Fatal Error Maximum function nesting level of '100' reached, aborting!'... Do you think I did something wrong? Should I try and re-install the module?

Link to comment
Share on other sites

  • adrian pinned and locked this topic
  • adrian unpinned and pinned this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...