def generateRow(self, state): first = True fmt = console.color(5) + "%s=" + console.nocolor() + "%s"; sep = console.color(5) + ", " + console.nocolor() row = "" for mc in self.columns: values = mc.func(state) if type(values) != tuple: values = (values,) for n, col in enumerate(mc.columns): if not first: row += sep else: first = False row += fmt % (col.id, col.fmt % values[n]) return row
def format(self, record): return console.color(_color_map[record.levelno]) + logging.Formatter.format(self, record) + console.nocolor()