Comments (21)
I'd like to bring this back to life. I think that, at the very least, it should be possible to override the stylesheet definition. As an alternative, perhaps we could work on the blue screen included in the package itself.
In my honest opinion, the blue screen could do with a minimal/modern facelift. The red is quite peircing to the eye (for me, anyway), and system native fonts would look great. The idea of multiple 'skins' could very well be overkill, and so my thinking is just to improve its appearance in such a way that it's more comfortable.
Here's a screenshot of a stylesheet I worked on today:
@dg, do you think this could be worked on?
from tracy.
I added Tracy\Debugger::getBlueScreen()->userCssFile
Tracy\Debugger::$customCssFile
to allow to add custom CSS file.
from tracy.
I've changed it yet to array $customCssFiles
from tracy.
@Sanjoy87 The error page that Tracy renders on fatal error or uncatched exception is only a last resort. Therefore it is as simple as possible and you cannot customize it.
You should do something similar to this
Tracy\Debugger::enable();
try {
$myApplication->run();
} catch (\Exception $e) {
if ( ! Tracy\Debugger::$productionMode) {
throw $e;
}
Tracy\Debugger::log($e, 'error');
$myApplication->renderErrorPage($e);
}
this should allow you to
- always log exceptions in production mode
- render your own custom pages
- in development mode the bluescreen will render immediately without the need to check logs
from tracy.
@fprochazka if I understood it correctly, @Sanjoy87 was talking about blue-screen.
from tracy.
Oh, in that case, there are bluescreen panels that you can use for adding information.
For example rendering of SQL that caused the exception, used like this:
Nette\Diagnostics\Debugger::getBlueScreen()
->addPanel('Nette\Bridges\DatabaseTracy\ConnectionPanel::renderException');
But there is no way to customize bluescreen design at this point.
from tracy.
@Sanjoy87 This is how Nette Framework customizes Tracy for itself: https://github.com/dg/nette/blob/506b1e6e3470f31caa1e923528bcd1750e18b392/Nette/Bridges/Framework/TracyBridge.php
from tracy.
Thanks @fprochazka @hrach @JanTvrdik all of you for quick response. Tracy is really awesome project so far.
I can see we can do some small changes with blue screen object. Tracy is standalone component. In this case it should be more flexible to customize (Development mode) according to the project though it has various features in it.
No idea how much my comments are valid for this project but i found few features can be added.
For example -
In the right side bottom of the exception page it shows _"Tracy - Nette Framework"_. So if tracy integrated with any other framework or project then it should not display "Nette Framework".
Using blue screen object allow us to add panel to the exception page, but panel displays two times, first one top as top panel next one after Call Stack, what if developer require only the first panel ?
If we add html tag to first panel title it simply displaying it into the browser.
$blueScreen->addPanel(function($e) {
return array(
'tab' => '<h1>My Framework </h1> ', // instead of My Framework
'panel' => '<h1> <span style="color:blue">My Framework </span> </h1>'// Works
);
});
It will be really great if you please add feature to customise template with external stylesheet.
Why it is requiring all files inside tracy.php[https://github.com/nette/tracy/blob/master/src/tracy.php]? Since tracy is composer powered, everything can be autoloaded right. So that it will look much better.
Hope it helps.
Thanks
from tracy.
it shows "Tracy - Nette Framework".
You mean the tiny text in Tracy logo? That's unlikely to change.
what if developer require only the first panel?
That's that the parameter $e
is for. You should return the array only if $e
is NULL
.
If we add html tag to first panel title it simply displaying it into the browser.
And that's OK. It's a panel title, it should not contain any HTML tags.
Why it is requiring all files inside tracy.php
Because Tracy is usable without Composer as well. If you use Composer, you'll never need to load this file.
from tracy.
Yes it make sense. thanks @JanTvrdik .
You mean the tiny text in Tracy logo? That's unlikely to change.
Cygnite Framerwork is under MIT license, hope it is not a problem to integrate Tracy with. It seems we need to code a bit to fit Tracy with our color schema.
You can see Laravel Framework uses Whoops Error handler which is similar to Tracy but Laravel does theme changes with external stylesheet and template customization.
We can add same feature into Tracy to make it much more flexible.
Is there any discussion chat room for Tracy, if possible let me know if we can chat, to know much more about it.
Thanks for your response. Great work!
from tracy.
I could understand if you needed dark version but rebranding it is just silly. Getting rid of obsessions about tools visual style is more helpful then creating one. Tracy has quite polished appearance. And as a tool for debugging hers purpose is not to look colourful.
Maybe it would be useful to have interface for main framework and its version instead of constant Nette Framework. But that is something for @dg to decide. For now you can show it by adding BarPanel.
from tracy.
To allow to create skins for Tracy is not a bad idea.
from tracy.
All included in the exception-...-log.html
files?
from tracy.
from tracy.
I added Tracy\Debugger::getBlueScreen()->userCssFile to allow to add custom CSS file.
Thanks @dg this will be great!
Do you have any thoughts about adding similar options for the other css files as well?
bar.css
toggle.css
dumper.css
Currently I am overriding a lot of things in bar.css which mostly works great, but it's a bit hacky when it comes to loading my replacement css file when on the bluescreen page.
from tracy.
@mikerockett the red "bluescreen" is a distinguishing mark of Tracy and to change it would cause a negative reaction, which I really do not want.
(Btw, red was much more aggresive years ago :-) https://phpfashion.com/images/exception-ndebug.gif
It's possible to change the font to a system one, but I think nobody even noticed it, which makes me feel it is unnecessary.
from tracy.
@adrianbj So it would be better Tracy\Debugger::$userCssFile
that will be loaded after BlueScreen's & Bar's default CSS files?
from tracy.
So it would be better Tracy\Debugger::$userCssFile that will be loaded after BlueScreen's & Bar's CSS files?
Yes, this might be better - overriding, rather than replacing means that even if you add more DOM elements and related CSS rules to Tracy in the future, we don't need to worry about keeping our custom user css files up to date.
Caveat - CSS is not my favorite thing in the world, so maybe there is an even better approach?
from tracy.
Ok, I repushed it.
from tracy.
@dg Thank you, this is awesome. I can agree with the red and how folks are used to it - I get that it could cause a negative reaction. That said, I think it's 'old-school', and not so friendly on the eyes (mine, anyway). Nonetheless, this makes it super-easy to fix. π
from tracy.
Ok, I repushed it.
Thank you @dg - that is working really nicely :)
from tracy.
Related Issues (20)
- Error line is not highlighted on CLI mode HOT 5
- `Content-Length` warning is reported even when sending `FileResponse` HOT 1
- Compatibility with Latte 3
- Tracy causes scrollbars after the update HOT 2
- Body flex based design is overridden by bluescreen style
- PHP 8.2: dynamic properties are deprecated HOT 7
- 2 additional lines for VSCodium in open-editor.sh
- After expand services in DI panel opened in new window there is nothing rendered HOT 5
- Default setting log directory /log not works as written in documentation HOT 4
- Contents of DateTime is not dumped HOT 1
- TypeError: Tracy\Dumper\Describer::addPropertyTo(): Argument #2 ($k) must be of type string, int given HOT 4
- `Exposer` purges content of some implementations of `Ds\Collection` HOT 4
- Tracy distributed in phar file doesn't work on PHP7 from version 2.9.5 HOT 1
- PSR adapters: swap names HOT 4
- PHP 8.2: ErrorException::$skippable is deprecated HOT 2
- Tracy\Helpers::editorUri() is_file() error with Latte StringLoader and open_basedir
- bar.css is missing background-repeat for #tracy-debug-bar HOT 1
- Ability to log all errors in development mode
- Unload event listeners are deprecated and will be removed
- Uncaught ReferenceError: Tracy is not defined HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tracy.