debug timing, colored terminal output

def debug(self, defn, args, kwargs, fmt=None, color='green'):
    """ debug timing, colored terminal output
    """
    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