Skip to content

Add optional PSR-3 logger and uninstall() - #2

Merged
mohaelmrabet merged 1 commit into
mainfrom
feat/logger-uninstall
Sep 4, 2026
Merged

mohaelmrabet merged 1 commit into
mainfrom
feat/logger-uninstall

Conversation

@mohaelmrabet

Copy link
Copy Markdown
Contributor

install() accepts a PSR-3 LoggerInterface as a second argument: the uncaught-exception line goes through $logger->error() (exception as context) instead of error_log() when supplied.

uninstall() restores PHP's default exception handler and makes the shutdown handler already registered a no-op (PHP has no unregister_shutdown_function()). Clears mapper, logger and shutdown interceptor so a later install() starts clean. isInstalled() added.

New required dependency: psr/log ^3.0.

install() accepts a PSR-3 LoggerInterface as a second argument: the
uncaught-exception line goes through $logger->error() (exception as
context) instead of error_log() when supplied.

uninstall() restores PHP's default exception handler and makes the
shutdown handler already registered a no-op (PHP has no
unregister_shutdown_function()). Clears mapper, logger and shutdown
interceptor so a later install() starts clean. isInstalled() added.

New required dependency: psr/log ^3.0.
@mohaelmrabet
mohaelmrabet merged commit 70e810e into main Sep 4, 2026
8 checks passed
@mohaelmrabet
mohaelmrabet deleted the feat/logger-uninstall branch September 4, 2026 21:36
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

Successfully merging this pull request may close these issues.

1 participant