我有一个具有记录器实例变量的类,我正在其中创建另一个类,我想在该类中使用记录器实例变量,但不知道如何调用它。
示例代码:
class A():
def __init__(self):
self.logger = Logger.get() #this works fine didn't include the Logger class
def func(self):
class B():
def __init__(self):
self.a = 'hello'
def log(self):
#How do I call A's logger to log B's self.a
#I tried self.logger, but that looks inside of the B Class