def __init__(self, name, filename, mode = 'a', delete = False): Log.__init__(self, name) self.filename = filename self.errorname = filename + '.error' self.mode = mode self.delete = delete self.do_log = True dirname = os.path.dirname(filename) if dirname: try: os.mkdir(dirname) except OSError as e: if e.errno != errno.EEXIST: raise
def __init__(self, name, filename, mode='a', delete=False): Log.__init__(self, name) self.filename = filename self.errorname = filename + '.error' self.mode = mode self.delete = delete self.do_log = True dirname = os.path.dirname(filename) if dirname: try: os.mkdir(dirname) except OSError, e: if e.errno != errno.EEXIST: raise