Jump to content

Tracy Debugger


adrian

Recommended Posts

  • 2 weeks later...
  • 1 month later...

Hi @Robin S - just wanted to confirm that you have everything working as expected now when editing Page Tables in a modal window?

@tpr - I am a little confused - what styles.css file are you talking about? The one included in TracyDebugger, or something else? How can you use this module in non-PW projects?

@hettiger - glad you like it - thanks!

PS Hi again everyone - it's been a while :)

  • Like 3
Link to comment
Share on other sites

  • 4 weeks later...

@adrian, what do you think of changing the "clear results" button in the console to a "don't clear results checkbox" meaning that every console submit clears the log unless the checkbox is checked.

i find myself having to clean the console a lot while developing those days... ;)

  • Like 1
Link to comment
Share on other sites

6 hours ago, bernhard said:

@adrian, what do you think of changing the "clear results" button in the console to a "don't clear results checkbox" meaning that every console submit clears the log unless the checkbox is checked.

i find myself having to clean the console a lot while developing those days... ;)

I'm happy to adapt if needed, but to be honest I almost always use the ALT+Enter option to run the code which automatically clears before running:

"Enter PHP code, then use CTRL/CMD+Enter to Run, or ALT/OPT+Enter to Clear & Run."

Does this work for you, or do you still think we need a change?

  • Like 1
Link to comment
Share on other sites

12 minutes ago, adrian said:

I almost always use the ALT+Enter option to run the code which automatically clears before running

Maybe default should be to clear it while ALT+Enter not to? If it's "almost always" then it would make sense, wouldn't it?

  • Like 1
Link to comment
Share on other sites

2 hours ago, szabesz said:

Maybe default should be to clear it while ALT+Enter not to? If it's "almost always" then it would make sense, wouldn't it?

Maybe, but on my Mac keyboard, the ALT key is closer to Enter than the CMD or CTRL keys, so for me that is the easier thing to use to clear and run. How many people out there are using the actual "Run" button instead of the shortcut? I know I do occasionally on page reload when the console isn't in focus, but it's not often. I guess my reasoning for a "Clear Results" button, rather than clearing by default is to keep it a little similar to the behavior you see with a regular terminal/command line where you have to explicitly clear what has been returned.

Any strong feelings on this?
 

PS - if we had two radios then we need to decide whether that status should be remembered or reset - sounding unnecessarily complicated to me :)

  • Like 1
Link to comment
Share on other sites

22 minutes ago, adrian said:

How many people out there are using the actual "Run" button instead of the shortcut?

Me :P and I'm quite happy with it so I was just wondering here... So, if shortcuts work well this way then just forget about my silly ideas.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

hi adrian,

is there a way to turn off tracy for some requests? i had some problems when generating pdfs with an nginx proxy showing 500 errors when i had warnings in the tracy bar. also this file's sourcecode looks not ideal to me:

<?php namespace ProcessWire;

echo 'here we are';
die();

output:

here we are<script src="?_tracy_bar=content.eaefb361ce&amp;XDEBUG_SESSION_STOP=1" data-id="eaefb361ce"></script>

is there some kind of switch to turn tracy off? then i would not have to think of it during development and it would avoid mistakes...

thanks :)

Link to comment
Share on other sites

Hey @bernhard - sorry I am not following exactly what happened when generating the PDF - can you please provide more details/code as I would like to investigate that further.

As for turning Tracy off - there is a "Disable Tracy" button on the Panel selector. There is also a dedicated "Tracy Toggler" panel/button. With either of these options, Tracy won't be loaded until it is enabled again, via a single icon that is positioned instead of the full Tracy debug bar. Is this what you are looking for, or are you wanting some other way to disable? I am still wondering if perhaps your PDF generating problem is indicative of a bug in Tracy that needs fixing. Is it an AJAX call? Code examples would be helpful please.

  • Like 1
Link to comment
Share on other sites

hi adrian,

no, thats not the problem at all. i don't think it is related to tracy. i think the problem is my nginx proxy that has some problems with some of the tracy output. don't know exactly and to be honest i'm not really interested in investigating at the moment ;)

i know about the toggle and on/off buttons of the tracy bar and they are really great and helpful. though in my special scenario it would be great to be able to turn off tracy from the API. like a $pages->of(false). that way i could disable tracy for the pdf generation process (i will not see the output anyhow) and tracy would stay enabled for all my other requests in the admin or on the frontend side.

the problem occurs only when i have some warnings in the tracy bar. maybe also on errors, i don't know exactly - it's very hard to debug... for me the easiest solution would be to add something like $tracy->off() at the top of my pdf script. but i'm fine with switching it on/off manually. i was just curious if an option like this already exists.

thank you

Link to comment
Share on other sites

I don't really understand still - surely if the PDF script is generating errors that Tracy is reporting, you'd want to know, but maybe there is some weird interaction that is causing problems when there really isn't any.

As for providing a way to switch off for some scripts, I just had a try at implementing something, but I don't think it's going to be possible because Tracy is loaded before anything else so that it can catch all errors, but this means that any variable you try to set from a script won't be available when it's time to enable Tracy or not. Does that make sense?

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Good day @adrian! Tracy debugger is one of the tools I can't live without no more Thanks for supporting it!

I got an unexpected behavior I can't explain. Tracy bar foes not appear on form sent (there is actually quite a lot happening processing that form). I does appear on all other pages of the site as expected though. That can cause such behavior?

Link to comment
Share on other sites

1 hour ago, Ivan Gretsky said:

Good day @adrian! Tracy debugger is one of the tools I can't live without no more Thanks for supporting it!

I got an unexpected behavior I can't explain. Tracy bar foes not appear on form sent (there is actually quite a lot happening processing that form). I does appear on all other pages of the site as expected though. That can cause such behavior?

Hi Ivan - without seeing the form code I don't really have any suggestions at the moment. Any chance the site is accessible to me to take a look?

Link to comment
Share on other sites

Just pushed a new version which has the following improvements:

  • Console panel calls now process /site/ready.php and /site/finished.php (along with /site/init.php which already worked) - thanks to @bernhard for help testing this.
  • Captain Hook panel now sorts hooks alphabetically within each file/class, rather than the old order by line number in the file - this makes it much easier to browse.
  • Updates to Ace editor (used in the console panel) and the Tracy core.
  • Some other tweaks.

Cheers!

  • Like 4
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...