Jump to content
adrian

Tracy Debugger

Recommended Posts

Hey @szabesz - a modules refresh and/or Tracy settings save will fix that. I converted one of the settings from a string to an array. I probably should have handled it better, but that's all you need to do.

  • Like 1

Share this post


Link to post
Share on other sites

Thanx for the help! Module refresh did not help but saving settings did.

 

  • Like 1

Share this post


Link to post
Share on other sites

Good day everybody!

When I think about TracyDebugger, I always think about the invaluable functionality of this must-have module. But yesterday I had a new impression about TracyDebugger - its super appealing design (in places). I was installing Tracy on a new site and was astonished by the new look of a "Donate" button in the module config. It is super simple and probably even a standard PayPal button, but it's placement and a color contrast just struck me.

I could not resist, clicked the button and made a $10000 donation. This is by far less than the value this module gives me, so wanted to give something back (and the magic button did its job, of course). But must be something with PayPal in Russia that it only let $5 of my donation pass though 😀.

So I suggest everybody go look at this button in the TracyConfig to learn some useful marketing tricks. And if you happen to be somewhere outside Russia please click on it and try to make a more than $5 donation to check, if the same limits apply in your country. So we can report to PayPal or something)))

  • Like 4

Share this post


Link to post
Share on other sites
3 hours ago, Ivan Gretsky said:

only let $5 of my donation pass though

I can tell you how to transfer me the $9995 you could not get rid of, just PM me 😄

  • Like 2
  • Haha 1

Share this post


Link to post
Share on other sites

Hi everyone,

Just released v4.18 this morning which comes with the new Tracy core v2.6

I have managed to retain PHP 5.4.4+ support for now. If you are running PHP 7.1+ you will get the new Tracy core, otherwise you'll be using the old 2.5 branch. I decided not to ditch < 7.1 just yet because Debian stable still ships with 7.0.

Here's the list of changes:

1) New multiple AJAX debug bars

This allows you to see more than one consecutive AJAX call. There is a new module setting that controls the number of AJAX bars (default 3). Adjust this if you need, but keep in mind that you don't want lots of bars stacking up as you navigate around the PW admin where opening menu items / pages are all AJAX calls.

This new feature also means that the AJAX dumps panel no longer needs to store consecutive dumps, but if you still want that, then the Dumps Recorder panel will do that.

image.png.2360bdc05da937d7546ad872a808162b.png

 

2) BarDump (bd) and barDumpBig (bdb) calls now use LIVE

This feature was always not quite right in the Tracy core, but it has been rebuilt and is now the default for these calls. This makes the dumping of large / multiple objects 10x faster. It also means that we can probably increase the default maxDepth setting and increase the value for the barDumpBig even further. I haven't made these changes yet, but I am going to start testing here and see how it goes.

This means that there is no longer a need for the barDumpLive (bdl) method, so this has been removed.

3) Lots of other minor/rare bug fixes and improvements

Nothing worth mentioning specifically, but definitely worth having 🙂

There will likely be more improvements to these new core features coming pretty soon, so I'll make sure we stay up to date with those also.

Let me know if you notice any problems.

Cheers!

 

  • Like 7
  • Thanks 2

Share this post


Link to post
Share on other sites

Several more Tracy core updates just committed that improve live dump performance among other things.

I have also changed the default editor protocol handler from Sublime Text to VSCode - I feel like this will be a more useful default as it seems VSCode is gaining lots of users around here.

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, adrian said:

have also changed the default editor protocol handler from Sublime Text to VSCode - I feel like this will be a more useful default as it seems VSCode is gaining lots of users around here.

Hooray! Any tip how to set this up for a linux box? Ta!

Share this post


Link to post
Share on other sites
6 minutes ago, adrian said:

I'll have a look, cheers!

Btw, for some reason I still thought Tracy does not support debugging in a modal?! I only noticed the setting yesterday when we were trying to help @JoshoB with the asmSelect problem! How this could have helped me recently, with VPS (lots of modal interaction)! I feel foolish 🙃. Thanks for Tracy again, @adrian!

 

  • Like 1

Share this post


Link to post
Share on other sites
30 minutes ago, kongondo said:

Btw, for some reason I still thought Tracy does not support debugging in a modal?

Sorry, perhaps those should not be disabled by default - generally I find it a bit obtrusive having the debug bar on in a modal and in general we are talking about the PW admin for these, so usually you don't need to debug them. Occasionally I enable them for a particular need.

  • Like 2

Share this post


Link to post
Share on other sites

Adrian, I can't maximize the console panel, I see this error in Chrome console:

Uncaught ReferenceError: tracyPanel is not defined
    at tracyResizePanel (?_tracy_bar=js&v=2.6.1&XDEBUG_SESSION_STOP=1:1130)
    at HTMLAnchorElement.onclick (?id=1015&s=1&c=1:1744)

Not sure when this started...

 

 

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, matjazp said:

Adrian, I can't maximize the console panel, I see this error in Chrome console:

Thanks for the report - looks like the new Tracy core is forcing strict rules in JS which is affecting some sloppiness in my code. I have fixed this one, but I think we'll need to lookout for issues like this.

 

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

I think this is a newbie question but I am trying to use Tracy Debugger to debug code on the a field in the Template context but gives me the error:

- "Fatal error: Uncaught Error: Call to undefined function ProcessWire\barDump()"

I tried to use:

TD::barDump('test');

and

$TD = $this->modules->get('TracyDebugger');
$TD::barDump('test');

but also gives an error.

How can I call the barDump() on a field in the template context ?

Many thanks

Share this post


Link to post
Share on other sites

Hi @bluellyr - in general you should use the shortcut methods: bd(), d(), l(), fl(), etc but if for some reason you don't want to, try: \TD::barDump('test');

The reason you need the backslash is because your template files have the ProcessWire namespace so you need to get to the global namespace to access the TD class.

Share this post


Link to post
Share on other sites
2 minutes ago, adrian said:

Hi @bluellyr - in general you should use the shortcut methods: bd(), d(), l(), fl(), etc but if for some reason you don't want to, try: \TD::barDump('test');

The reason you need the backslash is because your template files have the ProcessWire namespace so you need to get to the global namespace to access the TD class.

 

Hi,

even using: \TD::barDump('test'); or  bd(), d(), l(), fl(), when trying to debug a field on the template context I always get the following error, in this case I was trying to use \TD::barDump('test');

I think that is because the module Tracy Debugger is not loaded when editing a field on the template context, can this be the case?

Thank you

Screenshot 2019-03-05 at 13.30.43.png

Share this post


Link to post
Share on other sites

Sorry @bluellyr - my apologies - I didn't initially realize what you meant by "template context". Using Tracy to debug the PW core is hit and miss. It loads before all site modules, but for the core and core modules it often isn't available depending on exactly what you are trying to debug. Unfortunately there isn't anything I can do about this. Typically for this, using $log->save('testing', json_encode($page)); or something like that is your best bet.

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, adrian said:

Sorry @bluellyr - my apologies - I didn't initially realize what you meant by "template context". Using Tracy to debug the PW core is hit and miss. It loads before all site modules, but for the core and core modules it often isn't available depending on exactly what you are trying to debug. Unfortunately there isn't anything I can do about this. Typically for this, using $log->save('testing', json_encode($page)); or something like that is your best bet.

Thank you, for the explanation and for the alternative.

All the best

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, adrian said:

Using Tracy to debug the PW core is hit and miss. It loads before all site modules, but for the core and core modules it often isn't available depending on exactly what you are trying to debug.

It often happens to me too. I know Ryan made some adjustments in the core so that Tracy is loaded earlier (if I remember correctly), but is there really nothing that could be done in that regard? Could we have some sort of bd() function always available? Independent of the modules load order? Something that we put in init.php, even index.php? Yes, I do use $log methods, but Tracy is very handsome and good looking 🙂 

  • Like 1

Share this post


Link to post
Share on other sites
16 minutes ago, matjazp said:

It often happens to me too. I know Ryan made some adjustments in the core so that Tracy is loaded earlier (if I remember correctly), but is there really nothing that could be done in that regard? Could we have some sort of bd() function always available? Independent of the modules load order? Something that we put in init.php, even index.php? Yes, I do use $log methods, but Tracy is very handsome and good looking 🙂 

The changes Ryan made were to ensure that Tracy is always the first "site" module loaded. This means you can always debug other site modules. Getting Tracy to load earlier is problematic. init.php won't help - it already loads on init. 

I would like to be able to load Tracy earlier, but I don't see Ryan being keen on doing what is required to make that happen. You have got me thinking though about figuring out how we might be able to at least get bd() working earlier - this wouldn't include all of Tracy's other error capturing / reporting abilities, but I think it would still be helpful. 

I'll have a think about it.

  • Like 1

Share this post


Link to post
Share on other sites

@bluellyr, your screenshot shows a modal. Make sure you do not have the Tracy debug bar disabled for modals in the module config:

2019-03-06_092156.png.51b016961f3e7402a20b1f568d2ddfc2.png

@adrian, I wonder if it would be better to not have Tracy disabled for modals by default, and people can disable it if they are finding the debug bar annoying. And perhaps spell it out that no debug bar = errors if you try and use a dump method.

  • Like 2

Share this post


Link to post
Share on other sites

@Robin S - actually, I think you might be correct in this case. That was my initial thought, but some recent changes I made to Tracy should have actually prevented that error, so it threw me off. So I think it might be a combination of an older version of Tracy and the disabled in modal option.

I agree that the defaults should be for Tracy to be on in all those modals/panels/iframes - I have made this change in the latest version.

  • Like 3

Share this post


Link to post
Share on other sites

@bluellyr - could please let me know what version of Tracy you are running? Those errors should not have appeared on recent versions even with the modals disabled.

Share this post


Link to post
Share on other sites
23 minutes ago, adrian said:

@bluellyr - could please let me know what version of Tracy you are running? Those errors should not have appeared on recent versions even with the modals disabled.

Hi, I am using the Tracy Debugger 4.17.18.

Regarding the @Robin S remark about the having the "Tracy debug bar disabled for modals", I had the Tracy Debug disable for modals, can this be the cause of the error?

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 bernhard
      --- Please use RockFinder3 ---
    • By MoritzLost
      Cacheable Placeholders
      This module allows you to have pieces of dynamic content inside cached output. This aims to solve the common problem of having a mostly cacheable site, but with pieces of dynamic output here and there.  Consider this simple example, where you want to output a custom greeting to the current user:
      <h1>Good morning, <?= ucfirst($user->name) ?></h1> This snippet means you can't use the template cache (at least for logged-in users), because each user has a different name. Even if 99% of your output is static, you can only cache the pieces that you know won't include this personal greeting. A more common example would be CSRF tokens for HTML forms - those need to be unique by definition, so you can't cache the form wholesale.
      This module solves this problem by introducing cacheable placeholders - small placeholder tokens that get replaced during every request. The replacement is done inside a Page::render hook so it runs during every request, even if the response is served from the template cache. So you can use something like this:
      <h1>Good morning, {{{greeting}}}</h1> Replacement tokens are defined with a callback function that produces the appropriate output and added to the module through a simple hook:
      // site/ready.php wire()->addHookAfter('CachePlaceholders::getTokens', function (HookEvent $e) { $tokens = $e->return; $tokens['greeting'] = [ 'callback' => function (array $tokenData) { return ucfirst(wire('user')->name); } ]; $e->return = $tokens; }); Tokens can also include parameters that are parsed and passed to the callback function. There are more fully annotated examples and step-by-step instructions in the README on Github!
      Features
      A simple and fast token parser that calls the appropriate callback and runs automatically. Tokens may include multiple named or positional parameters, as well as multi-value parameters. A manual mode that allows you to replace tokens in custom pieces of cached content (useful if you're using the $cache API). Some built-in tokens for common use-cases: CSRF-Tokens, replacing values from superglobals and producing random hexadecimal strings. The token format is completely customizable, all delimiters can be changed to avoid collisions with existing tag parsers or template languages. Links
      Github Repository & documentation Module directory (pending approval) If you are interested in learning more, the README is very extensive, with more usage examples, code samples and usage instructions!
    • By Craig
      I've been using Fathom Analytics for a while now and on a growing number of sites, so thought it was about time there was a PW module for it.
      WayFathomAnalytics
      WayFathomAnalytics is a group of modules which will allow you to view your Fathom Analytics dashboard in the PW admin panel and (optionally) automatically add and configure the tracking code on front-end pages.
      Links
      GitHub Readme & documentation Download Zip Modules directory Module settings screenshot What is Fathom Analytics?
      Fathom Analytics is a simple, privacy-focused website analytics tool for bloggers and businesses.

      Stop scrolling through pages of reports and collecting gobs of personal data about your visitors, both of which you probably don't need. Fathom is a simple and private website analytics platform that lets you focus on what's important: your business.
      Privacy focused Fast-loading dashboards, all data is on a single screen Easy to get what you need, no training required Unlimited email reports Private or public dashboard sharing Cookie notices not required (it doesn't use cookies or collect personal data) Displays: top content, top referrers, top goals and more
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      Since 0.0.4, instructions and changelog can be found in the README only. You can find it here  🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github, thanks!
    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
×
×
  • Create New...