Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to log all errors in development mode #575

Open
maryo opened this issue Feb 25, 2024 · 0 comments
Open

Ability to log all errors in development mode #575

maryo opened this issue Feb 25, 2024 · 0 comments

Comments

@maryo
Copy link

maryo commented Feb 25, 2024

We'd like to be able to log all errors in development mode so they are both displayed in the bar but also logged using (our instance of) ILogger.
This would help up us not only when debugging errors during AJAX calls or some server-server requests, there are multiple use cases where this is useful (we have a special page with links to all older bluescreens).

Currently, the are DevelopmentStrategy and ProductionStrategy classes but they are both internal and final. I understand it is for a reason but...
In 2.9.7, the internal method getStrategy has no return typehint so it is still possible to do some black magic like decorating the strategy to do both 😇 👿.

\Closure::bind(
    static function () {
        Debugger::$strategy[false] = new LoggingDevelopmentStrategy(Debugger::getStrategy());
    },
    null,
    Debugger::class
)();

Since 2.10.0 the getStrategy has ProductionStrategy|DevelopmentStrategy return typehint so this ugly hack is not possible anymore.
Wouldn't it be possible to support such a feature or somehow make this ugly hack possible again 😇?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant