Exemple #1
0
  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
Exemple #2
0
 def format(self, record):
   return console.color(_color_map[record.levelno]) + logging.Formatter.format(self, record) + console.nocolor()