本文整理匯總了Python中core.logger.Logger.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.__init__方法的具體用法?Python Logger.__init__怎麽用?Python Logger.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core.logger.Logger
的用法示例。
在下文中一共展示了Logger.__init__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: activateLogDir
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import __init__ [as 別名]
def activateLogDir(self):
""" create the log directory and create the versions.xml file
The log dir should be avtivate only if this object is tested as a valid toad subjects
See Valifation.isAToadSubject()
"""
if not os.path.exists(self.__logDir):
self.info("creating log dir {}".format(self.__logDir))
os.mkdir(self.__logDir)
Logger.__init__(self, self.__logDir)
示例2: __init__
# 需要導入模塊: from core.logger import Logger [as 別名]
# 或者: from core.logger.Logger import __init__ [as 別名]
def __init__(self, config):
"""A valid individual who have the capability to run tasks.
This class have the responsability to write a document of the softwares and versions
into the log directory
Must be validated as a prerequisite
Args:
config: a self.config ConfigParser object.
"""
self.__config = config
self.__subjectDir = self.__config.get('arguments', 'subjectDir')
self.__name = os.path.basename(self.__subjectDir)
self.__logDir = os.path.join(self.__subjectDir, self.__config.get('dir', 'log'))
#the subject logger must be call without file information during initialization
Logger.__init__(self)
Lock.__init__(self, self.__logDir, self.__name)
Validation.__init__(self, self.__subjectDir, self.__config)