This is my parent class,
class BaseResource:
def __init__(self):
self.logger = logging.getLogger(__name__)
fmt = '[%(asctime)s] [%(levelname)s] [%(message)s] [--> %(pathname)s [%(process)d]:]'
logging.basicConfig(format=fmt, level=logging.DEBUG)
def log(self, msg):
self.logger.debug(msg)
This is my inherited object,
class SendOTP(BaseResource):
def __init__(self):
super(BaseResource, self).__init__()
def on_post(self, req, res):
self.logger.log("[FAILURE]..unable to read from POST data")
This throws up the following error,
AttributeError: 'SendOTP' object has no attribute 'logger'
What am I doing wrong here.
supercall tosuper().__init__()