Jump to content

Tracy debugger help, bd() and console


SamC
 Share

Recommended Posts

Hi,

I got round to installing the tracy debugger. Pretty lost with it tbh, looks like a huge variety of options. Anyway, just testing it out, but when I click on the console, there's nowhere to type:

58f4b4c0633e0_Screenshot2017-04-1713_25_35.thumb.png.799f1a03b096b929591ff852fe480f87.png

Looking at some screenshots, seems there should be a black box in there.

Not sure what I'm doing wrong here. Brand new install 3.0.42 with Tracy 4.3.2, using google chrome.

[SOLVED - SEE EDIT BELOW] One other thing, I wanted to test the 'bd()' method to see what's actually in the whole array. So I can't get the console working (as above) so I typed it straight in my template and I get some output in the dumps recorder. The array is bigger than what it output though so I can't see it all. I used it like this in the template:

<?php
    $json = file_get_contents($config->paths->templates . "/file.json");
    json_decode($json, $assoc = true);
    bd($json);
?>

...which outputs:

58f4b5ed624c7_Screenshot2017-04-1713_31_45.thumb.png.1e2aa6742e88403ca6832b687a48671f.png

I've been reading on this page: https://processwire.com/blog/posts/introducing-tracy-debugger/#dumps-recorder-panel but still not getting it right.

Any advice would be great, thanks.

 

 

==EDIT==

Solved the second bit by using:
 

<?php
    $json = json_decode(file_get_contents($config->paths->templates . "/file.json"), $assoc = true);
    bd($json);
?>

Still no console though.

  • Like 1
Link to comment
Share on other sites

Just to clarify the bd($json) issue in case you didn't realize what is going on there. You could dump the entire json string if you wanted by using bdl() - which is a shortcut for barDumpLive(), or you could specify bd($json, 'JSON, array('maxLength' => 877) which would make the string length displayed match the length of the actual string. Note the defaults for maxLength and maxDepth are configurable in the module config setting, but these can dramatically slow down rendering, so generally recommended to leave as is and supply in the bd() statement when you need to override.

Regarding the console panel - please open your browser console and let us know if you have any errors there - looks like the JS isn't being loaded.

  • Like 1
Link to comment
Share on other sites

1 hour ago, adrian said:

Just to clarify the bd($json) issue in case you didn't realize what is going on there. You could dump the entire json string if you wanted by using bdl() - which is a shortcut for barDumpLive(), or you could specify bd($json, 'JSON, array('maxLength' => 877) which would make the string length displayed match the length of the actual string. Note the defaults for maxLength and maxDepth are configurable in the module config setting, but these can dramatically slow down rendering, so generally recommended to leave as is and supply in the bd() statement when you need to override.

Regarding the console panel - please open your browser console and let us know if you have any errors there - looks like the JS isn't being loaded.

Thanks for the info.

Yes to the second point, got a 404 in the console, can't find:

/site/modules/TracyDebugger/ace-editor/ace.js

Maybe because when I installed the module, after unzipping, my path is actually:
 

/site/modules/TracyDebugger-master/ace-editor/ace.js

Guess you have to rename the folder and remove the '-master' bit after unzipping.

Link to comment
Share on other sites

The easiest way to install modules is to install by Class Name. That will ensure the directory name is correct. If a module isn't in the modules directory, you should use the URL (to the zip), or the Upload option. The old manual unzip and move to site/modules doesn't make any sense anymore.

58f538260e1d2_ScreenShot2017-04-18at7_48_00AM.thumb.png.ae3a1d681f5984ba2a6081273f3893f6.png

  • Like 2
Link to comment
Share on other sites

17 hours ago, adrian said:

@SamC - definitely use those methods for installing, but as an FYI, your issue did remind me that I used a poor approach to setting the paths to those resources which I just improved in 4.3.3, so thanks for the report.

No problem, glad to (accidentally) help :P

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...