I realize this isn't threadsafe, but I think in realworld conditions you'd be setting the logger in your main thread and it would be moot here... and the failure scenario is dropping 1 log message at the start of your app... so I don't think it's worth it to add a mutex here.