Jump to content

Tracy Debugger


adrian

Recommended Posts

Version 1.7.3 works fine, thanks!

Great - thanks for testing and letting me know! Back to the authorization issue - it is possible to send the username and password so it's possible to actually get the html of the page so it can be sent to the validator - let me know if you think that would be a worthwhile addition.

Speaking of new functionality, I have just had an idea for a "Notes" panel. The content would be unique to each page and the idea is that it would be a place to store notes about changes that are still needed for the page. I would store the info either in a dedicated sql table, or perhaps in JSON in a text file that can be parsed on load.

I know most of us make use of services like trello or similar for keeping track of tasks during development, but I am wondering if this might also be useful because the notes are available in the context of the viewed page.

I am also working on a TODO panel which parses out //TODO, //FIXME etc from your php scripts. Not sure if there is too much overlap between these two panels. I know that when I use //TODO in my code it's usually about code improvements/refactoring etc, whereas I think the Notes panel would be more about content/layout/functionality changes.

Anyway, I'd really appreciate hearing everyone's thoughts on whether they would find either of these useful and what the ideal approach for your workflow might be.

  • Like 2
Link to comment
Share on other sites

Quick FYI - I just committed support for using the Validator behind htaccess protected sites. There are new config settings for entering the username and password to be sent with the request.

@tpr has just tested for me and it's working great for him, but because I am using wireHttp->get first, and then falling back to file_get_contents, I am not sure if it will work for everyone as is. Not enough time right now to test thoroughly, so let me know if anyone using htaccess protection has any problems with this new one.

To quote @tpr - "I can no more hide behind htpasswd and say that "Everything is valid, trust me" :)"

  • Like 4
Link to comment
Share on other sites

Thanks Adrian for this great module.

I had some problem getting it to work. Installed on 3.0.18 and no Debug Panel on front end shown. There were some div but empty, and css js I've seen.

The module is using Master(dev) (master is dev?) automaticly and I have PHP 5.6.10. Once I switched to Stable it started showing the Panel on front end.


Also wanted to add that some of the panel are cut off on the left side by the screen.

Also a funny effect is that the modal of the debug panel are moving a bit towards top/left everytime I click on one to show/hide it.

  • Like 1
Link to comment
Share on other sites

The module is using Master(dev) (master is dev?) automaticly and I have PHP 5.6.10. Once I switched to Stable it started showing the Panel on front end.

I can confirm that this is happening on PHP 7.0.6 and since at least 3.0.17

  • Like 1
Link to comment
Share on other sites

Hey Soma and Charles,

Sorry about the issue with the master/dev version of the Tracy core - this is a recent problem that started 3 days ago: https://github.com/nette/tracy/issues/185 - I was hoping I would get a response that would help me get it going again, but still no luck, but hopefully it will be up and running again soon.

Soma - I think the panel positioning/moving issues have all been fixed in the master/dev version. I was contemplating backporting to stable, but the master version has been tagged as RC1, so I think it will be released as stable pretty shortly.

In summary, depending on your server you will probably need Stable for the moment - I'll update here as soon as master is reliable again because there are some great improvements in the new version.

  • Like 3
Link to comment
Share on other sites

I have just had an idea for a "Notes" panel. The content would be unique to each page and the idea is that it would be a place to store notes about changes that are still needed for the page. I would store the info either in a dedicated sql table, or perhaps in JSON in a text file that can be parsed on load.

I know most of us make use of services like trello or similar for keeping track of tasks during development, but I am wondering if this might also be useful because the notes are available in the context of the viewed page.

I am also working on a TODO panel which parses out //TODO, //FIXME etc from your php scripts. Not sure if there is too much overlap between these two panels. I know that when I use //TODO in my code it's usually about code improvements/refactoring etc, whereas I think the Notes panel would be more about content/layout/functionality changes.

I like the idea of turning this module into an issue tracker with debug support :) Jokes aside:

If we could somehow list both php code TODOs and these Notes in an aggregated view, that would be great. When I cannot list all of them, those notes/todos are are kinda useless. Also, I always put my todo list in priority order, my todo items are even further organized into "categories" such as: asap, before launch, after launch, "nice to have in the future", etc... since an unorganized list is not too useful either.

But the coolest thing would be to be able to indicate if a Note is only for the developer or for the client too. This way we could place Notes on the pages where they belong to, so that clients checking the site during development can instantly see what is done and what is still under construction, so they do not start reporting bugs, typos, missing elements, etc... in the first place. It could save a lot of time (fewer and shorter discussion/emails exchanged). Better yet, what if clients could also take Notes, I mean open issues belonging to that page? :) Ok, I stop it here, this is too much already...

  • Like 2
Link to comment
Share on other sites

I like where you are headed @szabesz - I think issue tracking displayed within the context of the page it refers to could be an excellent tool for giving and receiving feedback to/from clients. I am pretty excited about this because I have a hard time getting clients to interact with trello - maybe having this right on the website will make it more usable for them.

I am going on vacation for the next two weeks starting tomorrow, but I would like to look into this when I am back. It would be great to get more thoughts from others before I start coding it, so feel free to continue the conversation while I am gone. Anyone feel like mocking up the UI so we can plan the implementation well?

Back to the issue of the core Tracy master branch - that still hasn't been fixed so I have rolled the included code back to the version of the core before the problem showed up. I think that is the best compromise until it's fixed - at least this way you can get most of the improvements of the new version. Be sure to clear your browser cache if you find issues after rolling back - there were some CSS changes that caused the panels to be a bit buggy when I first rolled back.

See you all in a couple of weeks.

  • Like 2
Link to comment
Share on other sites

...I have a hard time getting clients to interact with trello - maybe having this right on the website will make it more usable for them.

I have already given up on them :) In my experience, only about 5-10% of them take the time to use such a tool (properly) anyway. I have a Word doc dedicated to this, with simple color coding. This is what they can/care to use. Very far from being perfect but at least something. The worst thing of using this "tool" is that my manual maintenance work is needed to keep it in a usable state.

...Anyone feel like mocking up the UI so we can plan the implementation well?

Currently I'm struggling with "time", but I'm interested so I will try my best to help. I also encourage others to join in the fun :)

Back to the issue of the core Tracy master branch - that still hasn't been fixed so I have rolled the included code back to the version of the core before the problem showed up...

Many thanks, enjoy your vacation!

  • Like 1
Link to comment
Share on other sites

Currently I'm struggling with "time", but I'm interested so I will try my best to help. I also encourage others to join in the fun 

Thanks - if you (or anyone else) get the time that would be great, but don't stress about it :)

  • Like 2
Link to comment
Share on other sites

"...too lazy to use greenshot for screenshots..."

I think this is the point! If they can just type their instructions ON the page itself where it belongs to, they do not have to make a screenshot. Sure, they still need to be able to express themselves clearly (they should at least try), but this way we know which page they are referring to (or at least part of it).

  • Like 1
Link to comment
Share on other sites

jep, that is correct. ok i think a comment feature with notification via email would be great! i always have to educate my clients to post the url where they are referencing to into the support mail. often they forget it. when they are able to comment directly on that page and not even have to open their mailclient it would be very handy!

maybe also put name + email + phone on that panel? like "how can i help you?"

leave your question directly here on the page or write me a mail or give me a phone call for more complex questions: xyz@example.com, +123 456 789

maybe that would make screenshots unnecessary in 90% of the cases, you could be right here :)

PS: maybe a support-panel, showing messages with kind of filter functionality:

show messages related to: this page | this template | this website

show messages depending on priority: high | medium | low

show messages depending on type: bug | request | comment

Link to comment
Share on other sites

"name + email + phone on that panel? like "how can i help you?"
We should only let authenticated clients (users) see this "Notes Panel" in the first place, shouldn't we? E.g. the developer sets up PW/Trace Debugger with a few users for people that might use it in the first place. From then on, there is no need for providing additional personal info.
Only drawback is that they need to be able to login... but they will use the site anyway, so time to learn "something new" :P

Filtering features are welcome, I think :D
However, what do you mean by: "this page | this template | this website"?
Another website? Aren't we working on the one in question already?
Also, do we really need filter for page vs template? The client doesn't understand it, so they do not need it. Any usecase for us, devs?

Priority: "high | medium | low" Personally I've never been able to use these. At first sight they look useful, but in reality these do not tell anything about desired deadlines. That is why I always use: asap, before launch, after launch, "nice to have in the future" or an actual deadline if any.
Message types: "bug | request | comment" quite useful, I think.

Link to comment
Share on other sites

hi szabesz,

"name + email + phone on that panel? like "how can i help you?"

of course i meant this panel to appear only for logged in users (clients). i guess it would be VERY good feeling for the client if she is working on the site and has a support or help badge on every site. something like a toggle on the right of every page. when clicking on the panel, there could be something like "ihr ansprechpartner" on this site: https://www.maletschek.at/boote/phobos-dalpol/phobos-21/

do you get what i mean? i think that would build trust and satisfaction for the client (not the website visitor). the most important thing of this panel should be a message box with a button "send comment"

something like this:

post-2137-0-75295900-1465909152_thumb.pn

However, what do you mean by: "this page | this template | this website"?

i meant a panel for admins/devs, where they can filter all submitted comments.

an example:

client comments:

- comment 1, page A, url /page-a, template event

- comment 2, page B, url /page-b, template guestbook

- comment 3, page C, url /page-c, template event

- comment 4, page A, url /page-a, template event

when fixing comment 1, it would be nice to have a button "show all messages related to this page". also it would be good to see comment 3 as it is related to the same template. clients would of course not need to do anything, as processwire knows all this from the referred page :)

i think such a feature would be great, but i'm not sure if tracydebugger would be the right place. maybe a dedicated support module would fit better?

ps: i really like the idea of logging errors on the client side as stated in the link in my posting above. don't know how hard that would be, but think of a comment like "XY does not show up on this page" and you could inspect a log of the clients console like "undefined variable xy..."

  • Like 1
Link to comment
Share on other sites

// firelog console

PHP Warning: ksort() expects parameter 1 to be array, null given in …/modules/TracyDebugger/DebugModePanel.inc:153

PHP Warning: Invalid argument supplied for foreach() in …/modules/TracyDebugger/DebugModePanel.inc:154

i'm using a sandbox-page for some api testing in my root-folder with bootstrapped api. the file only contains:

<?php
include('index.php');

// quick way to test api

i'm using 1.5.7 on pw 2.7.3

Link to comment
Share on other sites

Yeah, I fixed that a while back - Tracy is now at 1.7.7 :)

Btw - thanks very much to both you and @szabesz for all your thoughts on the notes/issue tracker panel. I am packing to leave shortly, so haven't liked/responded yet, but some great ideas/discussion which I'll respond to properly when I am back in two weeks.

  • Like 2
Link to comment
Share on other sites

Great ideas, but I'm not sure Tracy Debugger is the best place to add them. Perhaps it would deserve a new module.

If someone could open a new thread, then all ideas presented could be collected in one place.  Once (or if) a module is created, then another thread would be open under the Modules/Plugins category.  BTW, this is a good discussion.

  • Like 1
Link to comment
Share on other sites

If someone could open a new thread, then all ideas presented could be collected in one place.  Once (or if) a module is created, then another thread would be open under the Modules/Plugins category.  BTW, this is a good discussion.

Just heading out the door - honest :), but just wanted to say that I am definitely keen on the functionality being discussed and am keen to build it - I am also not sure if it belongs as part of Tracy, but I do like the idea of having one toolbar that can handle all my needs. As it is, I often also use horst's ALIF for the user switching functionality. I am not sure I would want a third toolbar for viewing TODOs, and posting/reviewing issues/bug tracking. I think that potentially Tracy could morph into something that is all encompassing because I think with the Panel Selector panel you have a very easy way of enabling/disabling tools quickly as needed.

I am interested to hear how the discussion has progressed when I am back, that's for sure.

  • Like 4
Link to comment
Share on other sites

Before I go, here's a preview of a php console that will be released when I am back. Enter code which runs in the background via ajax, with the results displayed below.

post-985-0-51727000-1465908900_thumb.gif

It will also support ACE editor for code highlighting and other cool things.

10/4, over and out!

  • Like 6
Link to comment
Share on other sites

.... I think with the Panel Selector panel you have a very easy way of enabling/disabling tools quickly as needed.

It's quite understandable that you want to stick to it, we like it too. It might be possible to separate the two modules (TD and "Notes") by introducing a third one that handles the panels and on which the two other modules depend, but it is extra work and probably not worth the effort, because we have "enabling/disabling tools quickly as needed" features already, so why bother dealing with separate modules when they are tightly integrated anyway?

The only reason to do it is to introduce a "Tracy Debugger panels" like API into the core, so that other developers can rely on it. That way Horst's ALIF (Admin Links In Frontend) module, Tracy and this so called "Notes" could live under the same hood.

I was also bold enough to think about somehow integrating/merging the GUI of not just these "three" modules mentioned above, but also the new GUI of the core Debug Mode Tools. However, so far I could not come up with a reasonable proposal since Debug Mode Tools has quite a different approach, while TD and ALIF are very similar in GUI terms.

Link to comment
Share on other sites

Hi bernhard,

....there could be something like "ihr ansprechpartner" on this site: https://www.maletschek.at/boote/phobos-dalpol/phobos-21/

I get it now. I wasn't thinking about developing for giant organizations where various people the dev has never heard of might post notes in this issue tracker. I've never worked for/in such an environment, but now I see why you might need it.

I also understand what you meant by "this page | this template | this website" :)

As for "somehow connecting the error log entries with client notes" idea, I also think it would be great to have something like that. It might also be possible to automate it based on the "time stamp" of the log entries and the "time stamp" of the Notes, by showing those side-by-side which happened about the same time. What if the client generated a lot of log entries? Showing the most suspicious ones might help too. But this might be an overkill, especially when things are normally running smoothly :)

Link to comment
Share on other sites

I was running an older version of Tracy Debugger (v1.2.9) and just upgraded to the latest (v1.7.7). Using the Tracy dev branch on the front-end I get 'Array to string conversion' errors in all of the panels. Tracy works fine in the back-end with dev branch, and also works on front-end and back-end with the stable branch.

An example error:

exception 'ErrorException' with message 'Array to string conversion' in ...\site\modules\TracyDebugger\ProcesswireInfoPanel.inc:334
Stack trace:
#0 ...\site\modules\TracyDebugger\ProcesswireInfoPanel.inc(334): Tracy\Bar->Tracy\{closure}(8, 'Array to string...', 'D:\\Websites\\__w...', 334, Array)
#1 ...\site\modules\TracyDebugger\tracy-master\src\Tracy\Bar.php(93): ProcesswireInfoPanel->getPanel()
#2 ...\site\modules\TracyDebugger\tracy-master\src\Tracy\Debugger.php(230): Tracy\Bar->render()
#3 [internal function]: Tracy\Debugger::shutdownHandler()
#4 {main}

PW is running locally on XAMPP, PHP v5.5.33

---------------------

Update: I found the source of the problem - there is a conflict between the dev branch of Tracy Debugger and FieldtypeTemplates (Template ASM Select).

Update 2: FieldtypeModules and FieldtypeFields also conflict.

Link to comment
Share on other sites

Hi @RobinS - thanks for the report - I am still away from the office and don't have a chance to test properly right now so not sure if I am on the right track, but would you mind testing the attached version of ProcesswireLogsPanel.inc (attachment removed as it is now available as part of the Github repo) - based on the error message I think it should fix things, but you mention the error is in all panels, however I think the error is likely just propagating through and is really on coming from this file.

Let me know if this works - if it doesn't, I sort it out properly when I am back in the 8th of June.

Thanks!

Edited by adrian
Removed attachment - no longer necessary
  • Like 1
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...