Jump to content

Tracy Debugger


adrian

Recommended Posts

Just now, netcarver said:

For example, another alternative is to just keep the existing button but make the basics a non-collapsed table with all the additional details in the collapsed sections following it. That would make the basics stand out pretty well in the issue reports.

I think that makes most sense.

Just like this or do you think that a table layout would help with clarity?

image.png.4d36b439b57a5a581899508a1055f318.png

 

  • Like 2
Link to comment
Share on other sites

Personally, I think a table would really help the clarity of the server details.

| Server | Version |
| ------:|:------- |
|     PW | $pw_version |
|    PHP | $php_version |
|   ...

Edited to add:

At least to my eye, it's hard to tell that the "Server Details", "Server Settings" and "Module Details" lines are actually click targets that open up a hidden list. Yeah, I know there are triangle markers as visual clues, but I mistook those simply as list-item markers the first couple of times I saw these in issues. I'm more used to click targets being styled as links or saying something like (more...) or something like that. 

  • Like 2
Link to comment
Share on other sites

Agreed, that does look nice. I have committed a new version with the following changes. Now we just need to get people using it more regularly ?

Each section is structured as a table and with the Server Details not collapsed.

image.png.7ff2a0578f53bd492ad47d9929e6b77d.png


The plain text version is basically the same, just with section titles added for clarity.

SERVER DETAILS
ProcessWire: 3.0.108
PHP: 7.2.6
Webserver: Apache/2.4.33 (Unix) 
MySQL: 8.0.11


SERVER SETTINGS
allow_url_fopen: 1
max_execution_time: 120 (changeable)
max_input_nesting_level: 64
max_input_time: 60
max_input_vars: 1000
memory_limit: 128M
post_max_size: 8M
upload_max_filesize: 50M
xdebug: 
xdebug.max_nesting_level: 
GD: bundled (2.1.0 compatible)
GIF: 1
JPG: 1
PNG: 1
EXIF Support: 1
FreeType: 1
Imagick Extension: 


MODULE DETAILS
AdminOnSteroids: 1.9.8
BatchChildEditor: 1.8.12
BreadcrumbDropdowns: 0.1.0
CookieManagementBanner: 0.2.1
FieldtypeStreetAddress: 0.5.1
FormBuilder: 0.3.4
InputfieldFormBuilderFile: 0.0.2
InputfieldStreetAddress: 0.5.1
JquerySelectize: 1.0.4
MarkupSEO: 0.8.7
MarkupSitemap: 0.4.1
ModuleReleaseNotes: 0.10.7
ModuleSettingsImportExport: 0.2.9
PageRenameOptions: 1.0.4
ProcessAdminActions: 0.6.12
ProcessChildrenCsvExport: 1.7.0
ProcessFormBuilder: 0.3.4
ProcessWireUpgrade: 0.0.7
ProcessWireUpgradeCheck: 0.0.7
RestrictTabView: 1.1.3
TextformatterTagParser: 2.2.0
TracyDebugger: 4.10.25


 

  • Like 3
Link to comment
Share on other sites

Just now, netcarver said:

@adrian

That's more like it! Thank you.

Except I didn't check the output in Github - I was using another Markdown editor which was rendering the tables correctly, but Github isn't - working on fixing it now.

  • Like 1
Link to comment
Share on other sites

21 minutes ago, adrian said:

Except I didn't check the output in Github - I was using another Markdown editor which was rendering the tables correctly, but Github isn't - working on fixing it now.

Ok, now the tables render correctly with Github's MD parser.

Take a look and let me know if you have any suggestions.

  • Like 1
Link to comment
Share on other sites

1 minute ago, netcarver said:

@adrian That works really well, thank you! My only other suggestion about the version lists I added here. At this stage, it really isn't important - the information is much more visible in this format.

 

3 hours ago, netcarver said:

At least to my eye, it's hard to tell that the "Server Details", "Server Settings" and "Module Details" lines are actually click targets that open up a hidden list. Yeah, I know there are triangle markers as visual clues, but I mistook those simply as list-item markers the first couple of times I saw these in issues. I'm more used to click targets being styled as links or saying something like (more...) or something like that. 

I am not sure there is much I can do about this - those triangles are how Markdown generates the output for <details><summary> tags. If you have any ideas on an alternate approach, let me know though. Regardless, I think the key things is that Ryan (and other PW Issues regulars) will get to know this output and how it works.

  • Like 1
Link to comment
Share on other sites

@adrian

I've been trying out the Custom PHP panel features and it's working really well. There's cake and icing - but I've thought of a cherry. There's still scrolling involved when iterating something in the custom panel when it comes to saving what you are doing - if the panel could be moved right to the bottom of the config inputs, that would put the save button within easy reach (for those who aren't using AOS's feature to fix the submit button on the header.)

  • Like 1
Link to comment
Share on other sites

9 hours ago, netcarver said:

@adrian

I've been trying out the Custom PHP panel features and it's working really well. There's cake and icing - but I've thought of a cherry. There's still scrolling involved when iterating something in the custom panel when it comes to saving what you are doing - if the panel could be moved right to the bottom of the config inputs, that would put the save button within easy reach (for those who aren't using AOS's feature to fix the submit button on the header.)

As you know (because you have been kindly testing it via PM), the new version now has an extra Submit button just below the customPHP code field to make it easier to quickly save and test multiple iterations of the code.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 8/3/2018 at 10:56 PM, Robin S said:

Hi Adrian, what do you think about adding a db() method/shortcut? So just like bdb() but for use (mainly) in the Tracy Console?

Sure thing - just added to the latest version.

I know you know this already, but just a reminder for others that you can also do:

d($page, [6]);

to control the exact depth of the array/object being dumped.

  • Like 3
Link to comment
Share on other sites

Would anyone be interested in having an option to make bd() and d() calls output two versions - one with debugInfo on and one with it off?

I am finding that I often want both because sometimes the debugInfo version is useless, but then sometimes it contains really useful info not available without it, eg @horst's new image info: https://github.com/processwire/processwire/pull/117

Any thoughts on this?

  • Like 1
Link to comment
Share on other sites

On 5/14/2018 at 9:14 AM, bernhard said:

hey adrian, hope you are enjoying your vacation!

what do you think of adding a section in the request info panel that shows the code needed for creating this field via api (for example in process module)?


$form->add([
  'type' => 'page',
  'label' => __('Mail auswählen'),
  'derefAsPage' => 1, // single or null
  'inputfield' => 'InputfieldAsmSelect',
  'template_id' => 73, // mail
  'value' => 23669,
]);

The request info panel has all the necessary informations:

2018-05-14--18-13-08.png.1382a9f99221aa4e2f8447bba9b6df15.png

If we had a section "Field code" we could just create fields in the Backend and then copy/paste them in our modules ?

Hey - sorry about the delay on this. I have looked at your PR and it looks like a useful addition. I am just wondering though - what about if we rather not use the array approach like you have there. I don't really have a preference, although I think moving forward, I'll probably go with this approach: https://github.com/adrianbj/CookieManagementBanner/blob/master/CookieManagementBanner.config.php

but at the moment, most of my modules work like this: 

        $f = $this->wire('modules')->get("InputfieldCheckbox");
        $f->attr('name', 'enabled');
        $f->label = __('Enable Tracy Debugger', __FILE__);
        $f->description = __('Uncheck to completely disable all Tracy Debugger features.', __FILE__);
        $f->columnWidth = 50;
        $f->attr('checked', $data['enabled'] == '1' ? 'checked' : '' );
        $fieldset->add($f);

Do you think we need a config setting to determine which style is output?

Link to comment
Share on other sites

5 hours ago, adrian said:

Would anyone be interested in having an option to make bd() and d() calls output two versions - one with debugInfo on and one with it off?

+1 I've been also wondering about this for a while ? 

Link to comment
Share on other sites

On 5/26/2018 at 7:19 PM, adrian said:

Hey @bernhard - regarding your fd() idea - is there a major difference between it and using l() which already dumps to Tracy log files?

thx, that's a perfect solution i didn't know about ? 

 

8 hours ago, adrian said:

Do you think we need a config setting to determine which style is output?

Of course that would be the best option, but I don't think many people will need it anyway... I prefer the array syntax nowadays.

  • Like 1
Link to comment
Share on other sites

@adrian

I think I found a bug in the Diagnostics panel - it incorrectly shows the group name of a given file/directory for me. I think you may need to change line 160 of DiagnosticsPanel.php (which seems to be using the file's owner ID, rather than its group ID) to...

$group = !file_exists($path) ? '' : posix_getgrgid(filegroup($path));

Best wishes,
Steve

  • Like 1
Link to comment
Share on other sites

5 minutes ago, netcarver said:

@adrian

I think I found a bug in the Diagnostics panel - it incorrectly shows the group name of a given file/directory for me. I think you may need to change line 160 of DiagnosticsPanel.php (which seems to be using the file's owner ID, rather than its group ID) to...


$group = !file_exists($path) ? '' : posix_getgrgid(filegroup($path));

Best wishes,
Steve

Hi Steve - thanks for finding and debugging this!

Testing here on MacOS and it doesn't make any difference for me. Both versions return:

image.png.7773d6b8148091a42efb01471e05246e.png

but if your version works for you, then it makes sense to replace it.

I have changed locally and I'll commit with the next version sometime soon.

 

  • Like 1
Link to comment
Share on other sites

@adrian Strange. I'm on a Linux mint - which seems to use the paradigm of creating a group named the same as each user. I'm not sure that MacOS does that. In these cases, the original code always seemed to report the file's group as being the same as the owner - even when it was not. 

When you ls -al in the terminal you are, presumably, seeing ajones:staff as the owner and group? I wasn't. I was getting sed:www-data in the terminal but sed:sed in Tracy.

Maybe others can chime in here - but if the new line isn't introducing a regression, I can verify it fixes a 'bug' for me.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, netcarver said:

When you ls -al in the terminal you are, presumably, seeing ajones:staff as the owner and group? I wasn't. I was getting sed:www-data in the terminal but sed:sed in Tracy.

Yes - as an example:

drwxr-xr-x   9 ajones  staff    288 Aug  6 09:36 wire

 

Since you playing around this panel and given your experience the Diagnostics module, I wonder if you have any thought about the Status and Notes that are being returned? Also, have you looked at the Filesystem Files option?

image.png.8df58eb3ff146d2f81934646b8e0b8e6.png

  • Like 1
Link to comment
Share on other sites

3 minutes ago, adrian said:

I wonder if you have any thought about the Status and Notes that are being returned?

Actually, I have been pondering making this more targeted. Let me gather thoughts and I'll either PM you a proof of concept or post more about it here.

  • Like 1
Link to comment
Share on other sites

On 1/31/2018 at 6:23 AM, adrian said:

You can also make use of the new:


bdb($var);

as a shortcut to:


bd($var, [6,999]);

hey adrian would you mind changing 999 to 9999 ? 999 is too low here for debugging my sql queries and I wonder why we have such a low setting for the "big" dump. I think it's fine to have a low setting for bd() but one would use bdb() only for dumping big dumps so I think 999 can often be limiting and then the benefit of having bdb() compared to bd($var, [6,9999]) is lost.

  • Like 2
Link to comment
Share on other sites

On 8/7/2018 at 1:03 PM, adrian said:

Testing here on MacOS and it doesn't make any difference for me. Both versions return:

Just and FYI: Ubuntu and Debian both display the correct information for me.

On another note, when minimizing the tracy bar (displayed lower right) it removes whichever panel is displayed. Is there a way to keep the target panel visible when the tracy bar is minimized? It doesn't matter if the panel is opened in a new window, the performance is the same.

Thanks for all your work on this module. It really is a time-saver.

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