adrian

Tracy Debugger

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
On 8/1/2018 at 9:33 AM, netcarver said:

@adrian Thank you. I was putting together a version-gathering script to collect the data to paste, as Markdown, into GitHub issues - then guess what I found elsewhere in TD 🤔

Where do I find this? 🙄

Share this post


Link to post
Share on other sites

@bernhard

On the "ProcessWire Info and Links" panel.

screeny-0011.thumb.png.0bf21509185f7125e3299a9b96d9d11d.png

...then look near the top of the panel for the version list...

screeny-0012.png.cb57126373c24c343c4ce59c03928f95.png

...hit the copy button and then paste as part of any issue you raise on the Processwire-Issues repo.

  • Like 1
  • Thanks 1

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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 🙂 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By OLSA
      Hello for all,
      ConfigurationForm fieldtype module is one my experiment from 2016.
      Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end.
      Install and setup:
      Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it:
      In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets").
      Basic usage example:
      ConfigForm fieldtype "setup" has subfields:
      "limit", type select, option values: 5, 10, 15, 20
      "sort", type select, option values: "-date", "date",  "-sort", "sort"
      // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort");  
      Screenshots:


       
      Notes:
      Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module.
      Thanks:
      Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin.
      In field type "link" I use javascript part from @marcostoll module and thanks to him for that part.
      Download:
      FieldtypeConfigForm.zip
      Edit: 14. August 2018. please delete/uninstall previously downloaded zip
      Regards.
         
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://gitlab.com/baumrock/RockPdf
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180810, v1.0.5, basic support for options fields 180528, v1.0.4, add custom select statement option 180516, change sql query method, bump version to 1.0.0 180515, multilang bugfix 180513, beta release <180513, preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. Thanks!
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/RockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour.
       
      Changelog
      180730 support subdir installations 180711 bugfix (naming issue) 180630 alpha realease  
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module: