3 ms·
Sure, but this choice shouldn't be the concern of the code writing the log message.
by goto11 4y ago
Sure, but this choice shouldn't be the concern of the code writing the log message.
- wizofaus 4y agoNo, but it might be an argument for not using generic interfaces where an implementation that literally does anything at all might be passed in. In C# and similar languages this could be done with an abstract base class with an internal constructor for instance. No idea if Python supports anything like that.
- goto11 4y agoIsn't this the approach the article is recommending against? Prefer composition over inheritance.
- wizofaus 4y agoThe logging target may be a property that is part of the composition of the logger itself, but it would still need to support interface- or abstract-"inheritance" (even if via duck-typing) to be useful.