Source Code:
(back to article)
class LoggingMixin: def log(self, message): print(f"Log: {message}") class MyClass(LoggingMixin): def do_something(self): self.log("Doing something...") my_object = MyClass() my_object.do_something()
Result:
Report an issue