Example #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
Example #2
1
def LOG_WRONG_CLIENT(entity, *kargs):
    if hasattr(entity, "id"):
        entity = entity.id
    BigWorld.logError("WRONG_CLIENT", " ".join(map(str, [_makeMsgHeader(sys._getframe(1)), entity, kargs])), None)
    return
def __excepthook(originalExceptHook, fileNameToTrim, exctype, value,
                 traceback):
    originalExceptHook(exctype, value, traceback)
    extMsg = extendedTracebackAsString(fileNameToTrim, None, None, exctype,
                                       value, traceback)
    BigWorld.logError('EXCEPTION', extMsg, None)
    return
Example #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
Example #5
0
def LOG_WRONG_CLIENT(entity, *kargs):
    if hasattr(entity, 'id'):
        entity = entity.id
    BigWorld.logError(
        'WRONG_CLIENT',
        ' '.join(map(str,
                     [_makeMsgHeader(sys._getframe(1)), entity, kargs])), 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
Example #7
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
Example #8
0
def __excepthook(originalExceptHook, fileNameToTrim, exctype, value, traceback):
    originalExceptHook(exctype, value, traceback)
    extMsg = extendedTracebackAsString(fileNameToTrim, None, None, exctype, value, traceback)
    BigWorld.logError('EXCEPTION', extMsg, None)
    return
Example #9
0
def LOG_CURRENT_EXCEPTION():
    from traceback import format_exc
    msg = _makeMsgHeader(sys._getframe(1)) + '\n' + format_exc()
    BigWorld.logError('EXCEPTION', msg, None)
    return
Example #10
0
def logError(message):
    BigWorld.logError(MOD_NAME, str(message), None)
 def error(self, msg, *args, **kwargs):
     if self._logLevel >= LOGLEVEL.ERR:
         BigWorld.logError(MOD_INFO.NAME, self._addLineNo(msg), None)
Example #12
0
	def exception():
		msg = _makeMsgHeader(sys._getframe(1)) + "\n"
		etype, value, tb = sys.exc_info()
		msg += "".join(format_exception(etype, value, tb, None))
		BigWorld.logError('EXCEPTION', log.prefix_with_timestamp(msg), None)
Example #13
0
def logError(msg):
    BigWorld.logError(MOD_NAME, msg, None)