Writing to log from within @staticmethod

I’m sure the answer is staring me in the face, but how can I write to the log from a @staticmethod? Obviously, self.log() isn’t going to work…


You make it not a static method. :slight_smile:

Or, when you are calling static method, pass the logger instance too

I’m not a Python expert but isn’t it counter productive to use a static method in a class when that method needs access to class objects?

Agree, it is not the best way to use static methods, on the other hand, it could be just something debugging purposes, rather than actual functionality.