Shopify/statsd-instrument — pull request #36 by lsantos (2014-02-28 22:11:09+00:00)
Title: Check if logger is available before sending log messages

I was wondering whether checking for the logger being available before sending messages to it would be a good idea.

I just had to deal with a long debugging session to pinpoint this problem, and the code I am suggesting is the same that I have running on my local changed version of the gem.

One could argue that is better to let the call fail, but the problem is that this is not easy to trace and understand where the error message is coming from. Moreover, I could not find anywhere in the documentation that setting up the logger is mandatory.

Perhaps making the logger required would be a better solution, but I am not sure.

Please let me know what you think.