Jump to content

Tracy Debugger


adrian

Recommended Posts

3 hours ago, tpr said:

You just made ALIF deprecated but I think @horst can live with that :)

I respectfully disagree, unless you are only talking about depreciating the user switching part of ALIF.  I use ALIF all of the time when logged in as an administrator.  I only turn-on Tracy Debugger whenever I need to debug something.  I have great use for both tools and would not like to see either one of them depreciated.  My opinion.

Edited by cstevensjr
clarified my objection
  • Like 4
Link to comment
Share on other sites

5 hours ago, tpr said:

You just made ALIF deprecated but I think @horst can live with that :)

I am not so sure about that :) and it certainly wasn't my intention.

ALIF has additional features that make it a worthwhile tool, like:

  • screen dimensions
  • session destroy
  • OPCacheStatus viewer

Also for those not using Tracy because they prefer a different PHP debugger, the user switcher in ALIF will still be indispensable.

 

  • Like 3
Link to comment
Share on other sites

4 hours ago, cstevensjr said:

I respectfully disagree, unless you are only talking about depreciating the user switching part of ALIF.  I use ALIF all of the time when logged in as an administrator.  I only turn-on Tracy Debugger whenever I need to debug something.  I have great use for both tools and would not like to see either one of them depreciated.  My opinion.

Thats what I was talking (thinking) about when agreed to @tpr and @szabesz : the use of the UA-Switcher. Honestly I think, when already using (installed) TracyDebugger, there is no need to have an additional UA-Switcher elsewhere.

But I'm using ALIF everytime. In my local (not yet released) version, ALIF even has a toggle button to switch on/off the TracyDebugger :)

alifs_tracy-toggle.png

And I use it in production sites for frontend edit- and logout- buttons for editors. That was the initial reason why I have written it.

  • Like 5
Link to comment
Share on other sites

@horst, Yes!  My clients love that ALIF shows up on the front-end.  It makes it easier for them and me to get to the back-end.  It's very visual and simple to explain to anyone.  I've been very happy ever since you made the ALIF module available.

Excellent work on having the Tracy toggle!  You and @adrian are to be greatly commended for doing some remarkable work on all of your modules.  Thanks.

  • Like 3
Link to comment
Share on other sites

Just upgraded, and I'm getting hundreds of errors like this, which are hanging the browser, and making Tracy unusable:

Warning: Unexpected character in input: '�' (ASCII=4) state=0 in .../site/assets/cache/FileCompiler/site/modules/TracyDebugger/TodoPanel.inc on line 190

 

Warning: Unexpected character in input: ' in .../site/assets/cache/FileCompiler/site/modules/TracyDebugger/TodoPanel.inc on line

I tried un-installing and re-installing but still can't use it...

Link to comment
Share on other sites

Hey @Macrura - sorry about that - what version of Tracy did you upgrade from? It sounds like perhaps you are having a similar issue to @bernhardhere: https://processwire.com/talk/topic/12208-tracy-debugger/?do=findComment&comment=123622

I can't think of any changes in recent versions that would cause this, but if it is just recent, could you figure out exactly which commit started the errors?

Also, to help me diagnose this it would be awesome if you guys could provide one of the files that the ToDo panel is scanning that is triggering this. Looks like I probably just need to encode all file content as UTF-8 before scanning for //todos etc, but having a test file to work with would be great.

Thanks.

Link to comment
Share on other sites

I don't know about the upgrade from/to because i deleted the previous one - sorry!

I also don't know anything about ToDo, i don't use it, and don't know how it works, but I'm sure i have a ton of whack stuff in my template files, so if it is trying to read those for anything particular, then i can easily see why it might crash; all of the templates are in UTF-8 i think but i put stuff like this at the top of some of them:

/**
    __  __
   / / / /___  ____ ___  ___
  / /_/ / __ \/ __ `__ \/ _ \
 / __  / /_/ / / / / / /  __/
/_/ /_/\____/_/ /_/ /_/\___/

 */

because I have a lot of template files open at once and this makes it easier to see where i am

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Macrura said:

I also don't know anything about ToDo, i don't use it

Does this mean you don't even have it enabled? 

This is what it looks like:

screen_shot_2016-06-18_at_2_13_52_pm.png

 

Note the 5/17 icon in the debug bar.

I can't see any problem with that ascii art in your template files. I am guessing it might be from some external JS libraries or something else in a site/templates/scripts subfolder.

The ToDo panel is not loaded by default when TracyDebugger is installed - it has to been added via the module config settings, or the Panel Selector.

Could you maybe try excluding any scripts subfolders like bernhard did and see if that fixes things. Of course you could also just disable the ToDo panel, but I would really appreciate a little help in diagnosing if you don't mind.

If excluding one of the folders works, it would be great to know the contents of those files - is there anything non UTF-8 in there?

Link to comment
Share on other sites

Hi @Macrura and @bernhard - I think the errors you are seeing are likely due to scanning of binary files.

I have added config options for setting directories to be completely ignored and also a list of file extensions to be scanned. The ToDo panel is now using a whitelist vs blacklist approach to the file extensions to be scanned. I have set up what I think are reasonable defaults:

Screen Shot 2016-07-09 at 10.49.09 PM.png

Hopefully this should take care of all the errors you are seeing - please let me know how it goes for you.

Also, if anyone has any suggestions for changes to the defaults, please let me know.

  • Like 2
Link to comment
Share on other sites

Just tried the User Swither and it seems very nice. My only concern is the GUI, I think the select limited to 1 is not the best control for selecting the active user. How about setting size="5" attribute for example, to save clicks? I would also set "min-width: 100%;" to make the rows full width. Perhaps this full width could be applied also on the session time input, to make it visually more attractive :)

  • Like 1
Link to comment
Share on other sites

FYI, the ToDo panel shows the entire jQuery minimized file contents because it starts with this comment:

/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */

To make it disappear, just delete the exclamation mark.

Edit: seems that it's not the case with newer jQuery's but as of v1.11.3 it's showing up

  • Like 1
Link to comment
Share on other sites

thank you adrian, the update solves this.

in my case it was a webfont. see attachment.

the folder ignore list is great! also the extensions. i'm not sure if it was even better to have a 3rd option "ignore filename". for example i have jquery.min.js inside my folder and that throws a huge todo-entry (like mentioned above). my solution was to move it to a folder "lib" and add this to ignore list

fonts.zip

  • Like 2
Link to comment
Share on other sites

1 hour ago, bernhard said:

i'm not sure if it was even better to have a 3rd option "ignore filename". for example i have jquery.min.js inside my folder and that throws a huge todo-entry (like mentioned above). my solution was to move it to a folder "lib" and add this to ignore list

I would exclude *.min.* per default. I think no one uses this for his work and adding ToDo comments.

  • Like 2
Link to comment
Share on other sites

Well that would make "/*! ... */" type comments disappear from the panel as currently this is the only way to include them. On minification these are kept in place. Of course I add comments to non-minified file but my templates pull the .min version of them which are generated on saving the files. Plus my src files are outside of /site directory so Tracy won't pick their comments up.

  • Like 1
Link to comment
Share on other sites

6 hours ago, tpr said:

Just tried the User Swither and it seems very nice. My only concern is the GUI, I think the select limited to 1 is not the best control for selecting the active user. How about setting size="5" attribute for example, to save clicks? I would also set "min-width: 100%;" to make the rows full width. Perhaps this full width could be applied also on the session time input, to make it visually more attractive :)

Thanks - I have made those changes here - will commit later.

 

5 hours ago, tpr said:

FYI, the ToDo panel shows the entire jQuery minimized file contents because it starts with this comment:


/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */

To make it disappear, just delete the exclamation mark.

Edit: seems that it's not the case with newer jQuery's but as of v1.11.3 it's showing up

I am not seeing the issue here, but it sounds like @bernhard is getting it also. I don't really understand why though. There is nothing between those /*! */ that should trigger a match - no: todo, bug, pending, etc. Even if there was a match, why would it show the entire contents of the minimized file since the contents are outside those comment delimiters. I am testing with that exact version of jquery. Do you have any ideas why the entire file contents are being matched for you guys and not me?

Link to comment
Share on other sites

Nevermind - I am an idiot - I was including jQuery via CDN :) Now I see what you guys are talking about - investigating a solution now!

EDIT: Turns out it's the hash(#) character in some regexes in jquery. Because I am using PHP's token_get_all to find comments, it is also finding these, because PHP allows for # comments. There is the word "pending" in the jquery code on the same line after a # which is why the entire line is being returned.

I don't have an idea for a quick fix at the moment, so this might have to wait till tomorrow. Anyone have any bright ideas?

Link to comment
Share on other sites

13 hours ago, adrian said:

Does this mean you don't even have it enabled?

I can't see any problem with that ascii art in your template files. I am guessing it might be from some external JS libraries or something else in a site/templates/scripts subfolder.

The ToDo panel is not loaded by default when TracyDebugger is installed - it has to been added via the module config settings, or the Panel Selector.

Could you maybe try excluding any scripts subfolders like bernhard did and see if that fixes things. Of course you could also just disable the ToDo panel, but I would really appreciate a little help in diagnosing if you don't mind.

If excluding one of the folders works, it would be great to know the contents of those files - is there anything non UTF-8 in there?

 

1) Right, I don't have ToDo enabled, but it still loads all 1000 warnings

2.) OK - yes there is a massive horde of js files inside my templates folder, because I have a /themes/ folder and inside there are like 5 themes, each with a ton of css and js files, and probably a lot of those are not UTF-8

I will go ahead and exclude everything now and see what happens (can't test much because it takes about 10 minutes to render the page with warnings!)

EDIT: SUCCESS

I disallowed a bunch of directories and i didn't have ToDo enabled in the module settings, but it was loading on the bar, until i actually went and turned of off from the bar; so now it all works, and the ToDo was actually loading, though i have it disabled now, will check it out later...

  • Like 1
Link to comment
Share on other sites

hey adrian,

what do you think of adding a tracy ON/OFF switch that is displayed as a little badge on every page. tracy makes pageloads a lot slower on my system and that can be really annoying when developing a site (like setting up some fields/templates). i know there's horsts ALIF module, but i don't really want to install another module just for that purpose and i think it would be better if tracy handled this on its own. also ALIF is only available in frontend, right? this button would make sense both in front- and backend.

  • Like 3
Link to comment
Share on other sites

23 hours ago, Macrura said:

I disallowed a bunch of directories and i didn't have ToDo enabled in the module settings, but it was loading on the bar, until i actually went and turned of off from the bar; so now it all works, and the ToDo was actually loading, though i have it disabled now, will check it out later...

Glad you had success by that combination. I think it is important if you have the ToDo panel enabled to exclude any external js/css libraries by putting them in a separate parent folder. Just to clarify - you say ToDo wasn't enabled in the settings but was showing on the bar - did you fix by clicking "Reset" on the Panel Selector? If so, then it must have been enabled via the "Sticky" option at some point.

8 hours ago, bernhard said:

what do you think of adding a tracy ON/OFF switch that is displayed as a little badge on every page. tracy makes pageloads a lot slower on my system

I have been thinking about adding this - sounds like a good idea. I am sorry to hear that it is slowing down page loading for you though. Can you narrow it down to a specific panel (look at generation times in the Panel Selector Panel). Also, did you by chance change the Max Nesting Depth setting in the config from the default of 3? I am in discussion with Ryan about this - there is some recursion going on that definitely slows things down for me if I make it larger than 3.

 

  • Like 1
Link to comment
Share on other sites

Thanks everyone for the feedback / issue reports the last couple of days.

  1. @tpr - I have taken care of the ToDo panel incorrectly reporting # type comments in js files. However I would still recommend that if you want to use the ToDo panel (which I find really useful :)), you should put any external js libraries in a separate master "libraries" (or similar) folder, like /site/templates/scripts/libraries/ and then add this to the directories to be excluded so that the panel doesn't have to scan all those files that aren't your code.
     
  2. @bernhard - am I correct in assuming you are running the SessionHandlerDB module? I see a significant slowdown with Tracy and that module. I really don't know how to deal with that at the moment other than suggesting you uninstall it on your dev environment. You can always install it on the live site for the advantages it provides, but because Tracy has a LOT of data stored in sessions, this becomes a problem when using that module. Could you please try uninstalling to confirm that things also speed up for you. For me on my current test PW install with that module uninstalled, enabling Tracy takes the page load from 800 to 925ms, which I think isn't bad at all. 
  3. @Macrura - now that you have excluded those directories, I'd love to hear if you find the ToDo panel useful - it has definitely made me start using the 'todo', 'fixme', 'pending', 'xxx', 'hack', 'bug' tags in my code more often now that I have a simple way to keep track of them on a page/template basis when viewing the site.


Keep the feedback coming everyone!

Link to comment
Share on other sites

hi adrian,

i'm not using sessionhandlerdb... anyway... it's not really important. i can surely live with switching it on/off ;) don't know what causes this issue though, but i have not enough time to investigate atm, sorry

Link to comment
Share on other sites

5 minutes ago, bernhard said:

hi adrian,

i'm not using sessionhandlerdb... anyway... it's not really important. i can surely live with switching it on/off ;) don't know what causes this issue though, but i have not enough time to investigate atm, sorry

I was hoping that was the issue - it certainly loads very quickly for me here. If you ever do find some time to investigate where the problem might be, I'd appreciate it.

  • Like 1
Link to comment
Share on other sites

Same here @adrian, unfortunately Tracy has always led to very slow page loads for me. I also don't use the sessionhandler module. I only switch Tracy on when I need to debug a specific error then switch it off again. I am only mentioning this to confirm the reported behaviour but have no further info to help you debug the issue, sorry :(.

Link to comment
Share on other sites

1 minute ago, kongondo said:

unfortunately Tracy has always led to very slow page loads for me.

Me too. I switch Tracy on only when I need it. Having a shortcut to toggle Tracy on/off would be great.

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...