Factoring out observability in classes, with a worked example: https://martinfowler.com/articles/domain-oriented-observability.html