def trace_dump(clear = True):
    '''trace_dump

    Dump to stdout current trace data at the current trace level. An optional
    clear parameter to reset or preserve the trace data. (default: True)

    See Also: enable_trace()
    '''
    if clear:
        tdata = coro.pop_local(CORO_LOCAL_TDATA, {})
        tlevl = _clr_trace_local()
    else:
        tdata = coro.get_local(CORO_LOCAL_TDATA, {})
        tlevl = _get_trace_local()

    if not tlevl:
        return None

    total, idcnt, count = 0, 0, 0
    
    for obj, data in tdata.items():
        for cmd, (elapse, ids, cnt) in data.items():
            total += elapse
            count += cnt
            idcnt += ids

            if tlevl > ACCESS_TRACE_TERSE:
                print 'Access | %0.4f | %4d | %4d | Summary (%s.%s)' % (
                    elapse, cnt, ids, obj, cmd)

    if not total:
        return None

    lmt = has_trace_limits()
    if lmt is None:
        lmt = ''
    else:
        lmt = 'limit: %s' % lmt
    print 'Access | %.4f | %4d | %4d | Summary (TOTAL) %s' % (
        total, count, idcnt, lmt)
dataset/ETHPy150Open slideinc/notifier/notifier/access.py/trace_dump/original