-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
GetBackendWithConfig
and make logging configurable per ba…
…ckend Introduces a new system for getting backends with a set of custom configuration that's a little cleaner than adding a new setter for every option that we add in the future. `BackendConfig` is introduced a user configurable struct which is then passed to `GetBackendWithConfig`, which returns a backend configured to spec. `GetBackend` remains, is backward compatible, and continues to set a default backend for either type. A new option on `BackendConfig` is being able to set a per-backend `Logger` and `LogLevel`. This is the impetus that sparked this change as documented in #608. So the unfortunate part is that `BackendConfig` is confusingly named similarly to the very poorly named `BackendConfiguration`, which is the final implementation of a backend. I wanted to keep this patch backward compatible, but I want to make a breaking change in the future to rename this to `backendImplementation` and make it unexported at the same time because it shouldn't be needed outside of the core package. We should also unexport `NewBackends` at the same time. It was introduced to allow some configuration for backends, but it was a pretty bad idea. Fixes #608.
- Loading branch information
Showing
5 changed files
with
189 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.