Open nigelcharman opened 6 years ago
My response:
Using a protected field is a fairly common practice.
A method would allow you to change the implementation, assuming Logger was an interface - eg. you wanted to return a different subclass, or a logger with a name different from the class name, based on some context that was passed in to the getLogger method?
I'm tempted to leave as a protected field, unless you think we might want different implementations to be returned?
Email from @andrew-sumner: