bernhard Posted January 20, 2021 Share Posted January 20, 2021 Hi @adrian I'm doing some more complex RockFinder operations and need to work with the dumped SQL statement. I have the dumpSQL() method for that, but since one of the last updates the newlines show up in that output: That makes it hard to copy the statement to mariadb and work on it there. Do you know how I can get rid of those \n characters? Thx --- Edit: I've now this quickfix in place: /** * Dump SQL of current finder to console (supports chaining) * @return RockFinder3 */ public function dumpSQL() { echo("<pre>".$this->getSQL()."</pre>"); return $this; } Not sure if there is a better solution? PPS: That is really annoying... whenever I'm doing bd($sql) I get the newline characters in my dump... ? I think they CAN be nice to have, but often they are totally useless and annoying. Maybe an option would be nice? Or is there already one? Link to comment Share on other sites More sharing options...
adrian Posted January 20, 2021 Share Posted January 20, 2021 @bernhard - this is something that was added to the Tracy core. Remember that you can use be() - barEcho() - to echo out a string to the dumps panel in the Tracy bar. Does that work OK for you? 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 20, 2021 Author Share Posted January 20, 2021 Thx @adrian I've already done that, but instead of bd($finder->getSQL()); I'd have to use be("<pre>".$finder->getSQL()."</pre>"); now ? See examples: Nicely formatted, but having \n: No \n but a pain to read: Nice format but hard to dump: Maybe I've found a CSS solution: .tracy-dump-string i { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } This prevents all <i> tags in the dump from being copied (at least on my chrome). Should we add that to the tracydebugger style? I've opened an issue at nette: https://github.com/nette/tracy/issues/458 1 Link to comment Share on other sites More sharing options...
adrian Posted January 20, 2021 Share Posted January 20, 2021 @bernhard - that css always works for me. I see that you just started an issue with the Tracy core which is great, but I can also just add that locally to the css that I package with the module. Seems like a good solution me although I am still unsure how much benefit actually showing the \n is in the first place. Note that the code for adding these, is all here: https://github.com/nette/tracy/blob/cf7d278957bd4301a409aa689159a9700459ff86/src/Tracy/Helpers.php#L343-L376 If there are strong opinions on this, I could potentially hack this file to remove these things, or it might be possible to convert back again in the module's code. Link to comment Share on other sites More sharing options...
bernhard Posted January 20, 2021 Author Share Posted January 20, 2021 Yeah, I think they are quite confusing. But I think they can also be very helpful in some situations... I'm also not sure about the padding on the left... Is that a core thing? 28 minutes ago, adrian said: I could potentially hack this file to remove these things, or it might be possible to convert back again in the module's code. The easiest would be a display:none on the <i> tags. But I'm really not sure if we should do that. It adds a lot of clarity to the dump (as one can see in the screenshot above). Maybe something like this? Not sure how to deal with it in the debug bar though ? Link to comment Share on other sites More sharing options...
flydev Posted January 21, 2021 Share Posted January 21, 2021 (edited) --- Edited January 21, 2021 by flydev ?? bad forum thread Link to comment Share on other sites More sharing options...
bernhard Posted January 21, 2021 Author Share Posted January 21, 2021 Hi @flydev ?? this is also due to the tracy core update, but it has nothing to do with the topic of this thread ? I think this has been discussed somewhere already... Link to comment Share on other sites More sharing options...
flydev Posted January 21, 2021 Share Posted January 21, 2021 I thought I was in Tracy's thread sorry ?♂️? Link to comment Share on other sites More sharing options...
bernhard Posted January 22, 2021 Author Share Posted January 22, 2021 @adrian david pushed a fix: https://github.com/nette/tracy/commit/cffea9d4a625eccc870144273e60cb131edd5d40 2 Link to comment Share on other sites More sharing options...
adrian Posted January 22, 2021 Share Posted January 22, 2021 Just now, bernhard said: @adrian david pushed a fix: https://github.com/nette/tracy/commit/cffea9d4a625eccc870144273e60cb131edd5d40 Yeah thanks. I am already using his latest release (with that fix) here. I'll commit the changes sometime soon. I just need to spend a bit of time revisiting the changes I made for Pete, and also revisit everyone's suggestions for improving the settings page, and also Robin's "Shortcuts" panel idea. I'll probably commit all these things together - maybe on the weekend or early next week. 3 Link to comment Share on other sites More sharing options...
bernhard Posted January 22, 2021 Author Share Posted January 22, 2021 No hurry at all ? Thx! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now