Skip to content

Add null loggers#172

Closed
cviebrock wants to merge 4 commits intosilverorange:masterfrom
cviebrock:add-null-loggers
Closed

Add null loggers#172
cviebrock wants to merge 4 commits intosilverorange:masterfrom
cviebrock:add-null-loggers

Conversation

@cviebrock
Copy link
Copy Markdown
Contributor

@cviebrock cviebrock commented Sep 9, 2025

Adds SwatNullExceptionLogger and SwatNullErrorLogger classes: implementations of the loggers that don't actually log anywhere.

Also adds the ability to clear out all the configured exception/error loggers.

This will save some conditional logic in downstream applications.

Note

The changes to composer.lock and SwatDB.php are unrelated to this PR. It looks like Jenkins was erasing the lock file during CI, which meant that a new minor version of PHP-CS would get installed ... and then CI would fail because the formatting rules would have slightly changed.

I erased and rebuilt the lock file (based on current package versions), fixed the one styling issue that CI identified due to the new PHP-CS version, and then updated the Jenkinsfile to not do this again.

@cviebrock cviebrock marked this pull request as draft September 9, 2025 20:47
@cviebrock cviebrock marked this pull request as ready for review March 11, 2026 14:28
@gauthierm
Copy link
Copy Markdown
Member

Clearing logging should not be necessary as we can just not add loggers when we don't want or need them. Logging configuration is typically done in application code. Depending on the framework, we can override the configuration on a case-by-case basis to use different logging configurations.

There also isn't much use for null loggers as we can opt to not add loggers if we don't want logging.

@gauthierm gauthierm closed this Mar 27, 2026
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.

2 participants