Jump to content

Tracy Debugger


adrian

Recommended Posts

7 hours ago, bernhard said:

I still have the bug on the AOS language switcher z-index. Any news on this?

I think this is something that @tpr needs to take care of in AOS, but if someone know better, please correct me.

8 hours ago, bernhard said:

On the config var the description column is very large, leading to a horizontal scrollbar. Maybe it would make sense to use text-overflow: ellipsis; here?

I actually think I am OK with the horizontal scroll in this case. I'd rather be able to read it all and I don't want to go with line break either. If others think this is annoying, please let me know and I'll reconsider.

8 hours ago, bernhard said:

Is it intended that the links to the api ref opens in the same window? I know we can middle-click, but I wonder if it was better to open it in a new tab by default?

Over the last few years I have come to really dislike forced new window/tab links unless there is a chance of data loss which I guess in this situation is possible if you're editing a page at the time, so I have introduced a config option under the Misc section to let you guys decide. This is the same as the option for the PW Info panel. I have also added it to the Captain Hook panel as well. So guys can choose what you prefer.

7 hours ago, gmclelland said:

How about adding a full screen button to the API Explorer panel?  Like it is with the Console panel.

I have added this to the latest version - also added to the Captain Hook panel as well.

9 hours ago, bernhard said:
10 hours ago, adrian said:

I am actually thinking about a link from the property to open the Console panel with the $object->property wrapped in a d() call, eg:

Sorry, I don't get what you are talking about

It's a link to automatically insert that code into the Console panel so you can easily dump it to get the value. Maybe it will make more sense when it's done ?

  • Thanks 1
Link to comment
Share on other sites

9 minutes ago, Robin S said:

Hi Adrian -  is the gap between the dump heading and the dump output deliberate? I think it would look better without a gap.

2018-10-25_110001.png.5f1a32b96c7d23e276bbd0f7eea24ee7.png

Recently introduced, unintentional bug ?

I have just committed a fix, although no version number bump just yet because I am working on other changes.

  • Like 1
Link to comment
Share on other sites

New version of the API Explorer. 

1) It now shows all core classes (rather than the previous select list), but it excludes those classes with matching API variables avoid duplicate content.

2) By default, methods inherited from Wire, WireArray, or WireData are no longer shown which dramatically decreases the size of the panel and makes it much easier to find what you are looking for. However if you want to see all methods, then you can check the new "Include inherited methods" config setting.

I would really appreciate some feedback on this new version. I am thinking about maybe showing inherited methods for the core classes, but not for the API variables (objects), but I'd really like to get thoughts from you guys on what you think will be most useful - I think it's a challenge to balance usefulness and clarity.

Thanks!

Link to comment
Share on other sites

Lots of improvements to the API Explorer have been committed and as far as I can tell it should now include all methods and properties for all PW objects and classes.

It's now definitely ready for primetime although I am sure I'll think of other improvements to add ?

Honestly I am learning about lots of methods/properties I didn't know about!

Hopefully you guys will find it the best first stop for api docs.

  • Like 4
Link to comment
Share on other sites

Inline with my last comment, I am thinking about adding an alert (with orange icon) when there are new properties/methods available after you upgrade to a new version of PW. Haven't decided on the exact interface yet, but if you like the idea and have any thoughts, feel free to suggest, but probably a simple note at the top of the panel detailing those new options and also highlighting in the tables. Probably with an option to "acknowledge" that you've seen the options to remove the notice. Something like that anyways.

  • Like 2
Link to comment
Share on other sites

4 hours ago, adrian said:

Probably with an option to "acknowledge" that you've seen the options to remove the notice. Something like that anyways.

+1, yep, it would be great to be able to decide when to dismiss it. I tend not to heave time to read all such things when they happen to pop-up. Also, if we could copy/paste them, then I could save it into my notes for later inspection.

Link to comment
Share on other sites

@adrian

While wokring on a site I faced a problem with hook and bd call in it.

wire()->addHookAfter("Page(template=blog-category)::path", function($e) {
	$page = $e->object;
	bd($e);
	$pages = wire('pages');
	$user = wire('user');
	$language = $user->language;
	$langSegment = $pages->get("/")->localPath($language);
	$pageName = $page->localName($language, true);
	$e->return = $langSegment . "$pageName/";
});

Such hook leads to 'Fatal error: Allowed memory size'. I have tested it on three different installations, got the same result even on clean installation with only TracyDebugger module. PW 3.0.117 and 3.0.116, the latest module version, PHP 7.2.4. 

Link to comment
Share on other sites

Hi @Zeka - I think is probably just a result of trying to bd() lots of complex PW objects. Try replacing the bd call with bd($e->object->title) and see if that helps. Or maybe you could use bd($e, [1]) as a shortcut to reduce the maxDepth of the dump.

The main thing is I don't think it's a problem with Tracy but rather just how much content is being dumped. How many bd() calls are being made in this hook in your setup?

Link to comment
Share on other sites

1 hour ago, Zeka said:

@adrian

Thanks, reducing of the maxDepth depth helped. But it's strange, as in earlier versions I have used bd calls in such hooks without maxDepth tuning. 

Would you mind checking what is the last old version of Tracy that doesn't have an issue with that hook in your setup? If there has been some change, I'd love to help sort it out. Perhaps it's when I introduced the debugInfo / Iterator / Full Object tabs in the dumped results? This is the commit where this was first introduced: https://github.com/adrianbj/TracyDebugger/commit/104a9457ec1eae78b46d139a631f798b2a042bf0

Link to comment
Share on other sites

@adrian

I tried such hook (without conditions) on PW 3.0.105 and TD 4.10.22 and it works as expected. I got 360 dumps. So, yes, probably it is somehow relative to new tabs in dump panel.

	wire()->addHook("Page::path", function($e) {
		bd($e);
		$page = $e->object;
		$e->return = "/{$page->name}/";
	});

 

  • Like 1
Link to comment
Share on other sites

Thanks for doing that test. Now the problem is that I am not really sure what to do. You do have the option to change what tabs are output:

image.png.cf5090d4167a23f526a2a19238218830.png

so I guess if you're coming across this a lot and don't want to (or can't increase) the PHP memory limit, then perhaps the best option is to drop back to one tab. Would you mind confirming that works for me?

 

Link to comment
Share on other sites

On 10/24/2018 at 11:19 PM, adrian said:
On 10/24/2018 at 1:54 PM, bernhard said:

I still have the bug on the AOS language switcher z-index. Any news on this?

I think this is something that @tpr needs to take care of in AOS, but if someone know better, please correct me.

@bernhard Yesterday I tried to replicate this but couldn't. Have you modified z-index in tracy, or have set sticky header in aos?

  • Thanks 1
Link to comment
Share on other sites

On 9/27/2018 at 3:02 AM, bernhard said:

One thing I noticed is that when I reload the page after adding a folder to the ignored-list the Todo-Panel was not activated any more. I activated it via the checkbox in the panel selector and clicked "sticky". After saving the module's settings this setting was gone. Is this a bug? Or can I activate this panel in another way?

Just wanted to let you know, that this will no longer be a problem. I have removed the code that cleared the sticky panels cookie when saving the config settings. I'll keep an eye on things because I am still not sure exactly why I added it in the first place, but it's definitely annoying ?

 

On another note, core modules and site modules classes are now optional available in the API Explorer panel, along with lots of other improvements.

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

Hey @adrian ,

I'm just developing a new module and using your todo-panel all the time. Now I had the plan to place some files in /site/assets and some in /site/templates, both having the folder name MyModule.

The "problem" is that I want the files in /site/templates indexed by the todo-panel, but not the files in /site/assets (that's an external library).

Is there any chance to make the filter more specific? Maybe a regex option? No problem at all if that is not easily possible, but if it is, I'd be thankful for such a feature ? 

Link to comment
Share on other sites

44 minutes ago, bernhard said:

Hey @adrian ,

I'm just developing a new module and using your todo-panel all the time. Now I had the plan to place some files in /site/assets and some in /site/templates, both having the folder name MyModule.

The "problem" is that I want the files in /site/templates indexed by the todo-panel, but not the files in /site/assets (that's an external library).

Is there any chance to make the filter more specific? Maybe a regex option? No problem at all if that is not easily possible, but if it is, I'd be thankful for such a feature ? 

I agree the current approach isn't great, but is it possible to simply add "/site/assets/MyModule" to the ignore list. Doesn't that achieve what you want?

If not, I'd certainly be happy for a regex approach.

  • Like 1
Link to comment
Share on other sites

Thx @adrian didn't know this was possible! Of course that's totally sufficient ? 

I guess I tried it with wrong directory separators because I'm on Windows... This does work now, but it might be better (possible?) to stick with one version of the slash?

site/modules\MyModule\src

 

  • Like 1
Link to comment
Share on other sites

New "Adminer" database GUI panel just added.

image.thumb.png.f6425cc60bdaf152b44f75527a4ad1f9.png.6b4315b8dfb634592e45d83b2921e858.png

A huge thanks to @Robin S for making me take another look at this long forgotten tool and for helping with many suggestions regarding the implementation in Tracy and debugging several issues.

There is one outstanding one on his local Windows dev setup that I can't reproduce at all and he also isn't seeing on a live server. He is getting session_start / headers already sent error. 

Could someone else on Windows (maybe @bernhard) take a look and let me know if you have the same problem as well.

Actually Robin - any chance you are running the SessionHandlerDB modules on that local setup?

The color scheme is configurable in the Tracy settings.

I have used this already on a live server to help debug something and it would have taken much longer to go find the cpanel credentials, and navigate my way to PHPMyAdmin. This logs you in automatically and is virtually instant.

I am away for the next 10 days so if you find any problems, they will most likely have to wait till I'm back.

Hope you find it useful!

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

Quick note to let you know that it's also possible to run Adminer directly via: /processwire/setup/adminer/ which may be preferable if you have lots of work to do and want it open in a more "permanent" way. At the moment I set the page as hidden so it actually won't appear under the Setup menu - I can change this, or perhaps I can have a link from the Adminer Tracy panel to open it this way. Any thoughts on which would be best?

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