• When developing locally I would like to use PHP’s native error handler instead of Bugsnag’s, but still have the same code base/database for my local and live server (and not being forced to manually deactivate the plugin for different servers).

    ATM it’s impossible to override with the bugsnag_set_error_and_exception_handlers filter from within functions.php (since it’s applied directly when the plugin loads (which is before the theme)). Would it be possible to run constructBugsnag() in the init hook or similar, and not directly when the plugin is loaded? That way I could disable bugsnag’s error handlers depending on my debug environment variable from within the theme’s function.php.

    I also tried running restore_error_handler();, but that results in this warning:

    
    strpos(): Empty needle in plugins\bugsnag\bugsnag-php\Error.php on line 386
    
    • This topic was modified 6 years, 7 months ago by fiskhandlarn.
    • This topic was modified 6 years, 7 months ago by fiskhandlarn.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Make it possible to disable plugin from theme?’ is closed to new replies.