VirtualBox

儲存庫 vbox 的更動 79445


忽略:
時間撮記:
2019-7-1 下午03:44:12 (6 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
131701
訊息:

ValKit/reporter.py: Adjusted error count log prefix (iDebug > 1) and once again tried to make traceback more useful when logging exceptions. bugref:9151

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/ValidationKit/testdriver/reporter.py

    r79318 r79445  
    499499        if iLevel <= self.iVerbose:
    500500            # format it.
    501             if self.iDebug > 0:
     501            if self.iDebug <= 0:
     502                sLogText = '%s %s' % (sTsPrf, sText);
     503            elif self.iDebug <= 1:
    502504                sLogText = '%s %30s: %s' % (sTsPrf, sCaller, sText);
    503505            else:
    504                 sLogText = '%s %s' % (sTsPrf, sText);
    505             if self.iDebug > 1:
    506                 sLogText = 'err=%u %s' % (self.cErrors, sLogText,);
     506                sLogText = '%s e=%u %30s: %s' % (sTsPrf, self.cErrors, sCaller, sText);
    507507
    508508            # output it.
     
    915915    def log(self, iLevel, sText, sCaller, sTsPrf):
    916916        if iLevel <= self.iVerbose:
    917             if self.iDebug > 0:
     917            if self.iDebug <= 0:
     918                sLogText = '%s %s' % (sTsPrf, sText);
     919            elif self.iDebug <= 1:
    918920                sLogText = '%s %30s: %s' % (sTsPrf, sCaller, sText);
    919921            else:
    920                 sLogText = '%s %s: %s' % (sTsPrf, self.sName, sText);
     922                sLogText = '%s e=%u %30s: %s' % (sTsPrf, self.cErrors, sCaller, sText);
    921923            self._writeOutput(sLogText);
    922924        return 0;
     
    11481150                try:
    11491151                    asInfo = formatExceptionOnly(oType, oValue, sCaller, sTsPrf);
     1152                    atEntries = traceback.extract_tb(oTraceback);
     1153                    atEntries.reverse();
    11501154                    if cFrames is not None and cFrames <= 1:
    1151                         asInfo = asInfo + traceback.format_tb(oTraceback, 1);
     1155                        if atEntries:
     1156                            asInfo = asInfo + traceback.format_list(atEntries[:1]);
    11521157                    else:
    1153                         asInfo.append('Traceback:')
    1154                         asInfo = asInfo + traceback.format_tb(oTraceback, cFrames);
     1158                        asInfo.append('Traceback (stack order):')
     1159                        if cFrames is not None and cFrames < len(atEntries):
     1160                            asInfo = asInfo + traceback.format_list(atEntries[:cFrames]);
     1161                        else:
     1162                            asInfo = asInfo + traceback.format_list(atEntries);
    11551163                        asInfo.append('Stack:')
    11561164                        asInfo = asInfo + traceback.format_stack(oTraceback.tb_frame.f_back, cFrames);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette