Пример #1
1
def LOG_CURRENT_EXCEPTION():
    msg = _makeMsgHeader(sys._getframe(1)) + "\n"
    etype, value, tb = sys.exc_info()
    msg += "".join(format_exception(etype, value, tb, None))
    BigWorld.logError("EXCEPTION", msg, None)
    extMsg = excepthook.extendedTracebackAsString(_src_file_trim_to, None, None, etype, value, tb)
    if extMsg:
        BigWorld.logError("EXCEPTION", extMsg, None)
    return
Пример #2
0
def LOG_WRAPPED_CURRENT_EXCEPTION(wrapperName, orgName, orgSource, orgLineno):
    sys.stderr.write('[%s] (%s, %d):' % ('EXCEPTION', orgSource, orgLineno))
    from sys import exc_info
    from traceback import format_tb, format_exception_only
    etype, value, tb = exc_info()
    if tb:
        list = ['Traceback (most recent call last):\n']
        list = list + format_tb(tb)
    else:
        list = []
    list = list
    for ln in list:
        if ln.find(wrapperName) == -1:
            sys.stderr.write(ln)

    list = format_exception_only(etype, value)
    for ln in list:
        sys.stderr.write(ln.replace(wrapperName, orgName))

    extMsg = excepthook.extendedTracebackAsString(_src_file_trim_to,
                                                  wrapperName, orgName, etype,
                                                  value, tb)
    if extMsg:
        BigWorld.logError('EXCEPTION', extMsg, None)
    return
def LOG_CURRENT_EXCEPTION(tags=None, frame=1):
    msg = _makeMsgHeader(sys._getframe(frame)) + '\n'
    etype, value, tb = sys.exc_info()
    msg += ''.join(format_exception(etype, value, tb, None))
    BigWorld.logError('EXCEPTION', _addTagsToMsg(tags, msg), None)
    extMsg = excepthook.extendedTracebackAsString(_src_file_trim_to, None, None, etype, value, tb)
    if extMsg:
        BigWorld.logError('EXCEPTION', _addTagsToMsg(tags, extMsg), None)
    return
Пример #4
0
def LOG_WRAPPED_CURRENT_EXCEPTION(wrapperName, orgName, orgSource, orgLineno):
    sys.stderr.write('[%s] (%s, %d):' % ('EXCEPTION', orgSource, orgLineno))
    from sys import exc_info
    from traceback import format_tb, format_exception_only
    etype, value, tb = exc_info()
    if tb:
        list = ['Traceback (most recent call last):\n']
        list = list + format_tb(tb)
    else:
        list = []
    list = list
    for ln in list:
        if ln.find(wrapperName) == -1:
            sys.stderr.write(ln)

    list = format_exception_only(etype, value)
    for ln in list:
        sys.stderr.write(ln.replace(wrapperName, orgName))

    extMsg = excepthook.extendedTracebackAsString(_src_file_trim_to, wrapperName, orgName, etype, value, tb)
    if extMsg:
        BigWorld.logError('EXCEPTION', extMsg, None)
    return