VirtualBox

Changeset 79445 in vbox


Ignore:
Timestamp:
Jul 1, 2019 3:44:12 PM (6 years ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.

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