def __init__(self, lid, level, msg, efile, eline): '''Constructor for the extended MemLog object. This object additional contains information about the filename as well as about the file number.''' MemLog.__init__(self, lid, level, msg) self.efile = efile self.eline = eline
def write_log(self, file_descriptor): '''Writes the message to the given file descriptor.''' MemLog.write_log_prefix(self, file_descriptor) if self.efile != None: file_descriptor.write("%s:" % self.efile) if self.eline != None: file_descriptor.write("%s:" % self.eline) MemLog.write_log_suffix(self, file_descriptor)
def to_list(self): '''Returns a list of the MemLogFile.''' result = MemLog.to_list(self) if self.efile != None: result.append(self.efile) if self.eline != None: result.append(self.eline) else: if self.eline != None: result.append(None) result.append(self.eline) return result
def __eq__(self, other): '''The equal method: if everything is the same, it's true.''' return MemLog.__eq__(self, other) \ and self.efile == other.efile \ and self.eline == other.eline
def __eq__(self, other): '''The equal method: if everything is the same, it's true.''' print("MemLogFile.__eq__ [%s]" % self.lid) return MemLog.__eq__(self, other) \ and self.efile == other.efile \ and self.eline == other.eline