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)
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)