code: def debug(self, defn, args, kwargs, fmt=None, color='green'):
      
      ta = datetime.datetime.now()
      rs = defn(*args, **kwargs)  
      tb = datetime.datetime.now() - ta
      fmt = fmt or "processed {defn} in {ms}ms"
      logmsg = fmt.format(ms=tb.microseconds/1000.0, defn=defn)
      "terminal output"
      print cl(logmsg, color)
      "logging output"
      logging.debug(logmsg)
      return rs
docs: debug timing, colored terminal output