Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch allows Logger to be used independent of the process-global state, while maintaining backward-compatibility. Before this patch, Logger was hard-coded to write to the process-global set of log writers. This meant that Logger could not be used independently of the global state, which made it impractical to re-use the Logger's "interface" more generally.
To support non-global loggers, this patch encapsulates the global state of loggo in a couple of new types: Loggers and Writers. Several new interfaces support this encapsulation. Likewise some useful functions are newly exported: NewMinLevelWriter, EffectiveMinLevel, and IsLevelEnabled. More direct use of Logger is supported by NewLogger and NewRootLogger.
In addition to some cleanup, this patch also factors out support for non-global logger config. This is exposed through the new LoggerConfig and LoggersConfig types as well as several factory functions.
A follow-up patch is forthcoming which will add a Record type that simplifies a number of function signatures. That patch will introduce (and work around) several backward incompatibilities. However, this patch maintains backward compatibility for all existing exported types and functions.
(Review request: http://reviews.vapour.ws/r/4725/)