fuel/log — pull request #3 by jeroenbourgois (2013-02-07 22:42:59+00:00)
Title: Monolog instance recreation check

If the monolog instance exists, and the _init function is called more than once,
any added handlers through pushHandler (thus inside $handlers array) are lost
because a new monolog instance is created. This check prevents that.

The fact that `_init` is called twice is something I do not fully understand. The reason I found this behaviour is because in a seperate custom package, I was calling `\Log::instance()->pushHandler` and when debugging I found that the `_init` was called. Both from my package as from inside fuel. The flow was:

- request page/url
- load fuel
- load my custom package
- initing the `\Log` instance from inside my custom package + add a Handler
- the error is caught by Fuel and the `\Log` instance is created again -> my Handler is lost
- only one error is logged to the file via the `StreamHandler`, but my custom handler is not called

I hope you can accept this fix or explain to me why it should behave like this - or how I should solve it in another way.

Thank you!

@pierot, @rob-bar, @jeroendp