I feel that the default logger can be cached here. If we do this, we can avoid duplicate logger creation, when calling setLogger with a null parameter.

Comment From: snicoll

Thanks for the PR but that complexifies the code quite a bit and an additional field for no concrete benefit.