Unanswered
To get rid of this you need to remove all print() statements in your code and replace them with self.logger.info
44 Views
0
Answers
3 years ago
3 years ago
I am getting an error that some of my functions do not have an attribute of "logger", which is causing some of our application to no longer function
— Tanner Yea 3 years agothe self is referring to the self from your extension.py so if it is in a different file you need to either pass the logger, or pass the request handler. Hope that makes sense.
— Trey Teter 3 years agoOne of the issues where this is occuring is a mapper based on the BaseMapper. How would I pass the handler/logger from that along?
— Tanner Yea 3 years agoThe best way to do that is during the instantiation of the mapper class. You need to create a new init method that takes a logger and every thing else. Then you need to instantiate self.logger so you can then use it in your method. then you need to call super().init with all the other needed values. Hope that makes sense.
— Trey Teter 3 years agoThe mapper is also using a query derived from the BaseQuery class. Could I use the logger within that?
— Tanner Yea 3 years ago