def setup(self): m = re.match(r'(\d{4}-\d{2}-\d{2} |)(\d{2}:\d{2}:\d{2}) \[([A-Z]+)\] (?:\[Minecraft\] )?(.*)', self.line) if m: g = m.groups() self.time = g[0]+g[1] self.level= g[2] self.data = g[3] else: self.level= "???" self.data = self.line.strip() self.time = get_timestamp(self.time)
def setup(self): if not self.time: self.time = get_timestamp(self.time) if not self.data: self.data = self.line