josevalim/logger — pull request #5 by fishcakez (2014-07-22 23:28:27+00:00)
Title: Ensure required handlers are always restarted

Changes `Logger.Supervisor` to `rest_for_one`:
* `Logger.Config` is before other handlers, and if it crashes all the other handlers will be restarted. This tries to ensure we have the sync protection.
* `Logger.ErrorHandler` is after the other handlers, there is no point forwarding messages when there is no handler to handler them. Also we don't want it crashing to bring down the other handlers.
* `Task` must be after the `Logger.Watcher` `Supervisor` to ensure it restarts the backends.

Changes the `Logger.Watcher` `Supervisor` to `one_for_one`. This is required just in case the starter `Task` fails and is restarted causing duplicate children. This has the side effect of preventing unintentional duplicate handlers on `Logger`.

Changes how `Logger.Watcher` works so that all backends are started concurrently. This provides the following features:
* Backends are started as fast as possible
* Simplifies starter `Task` code so it does not need to handle a backend that can't be started
* Starting the backends does not block the `Logger.ErrorHandler` being started