Changeset 92893 in vbox
- Timestamp:
- Dec 14, 2021 9:22:24 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 148848
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testdriver/reporter.py
r92309 r92893 1410 1410 # 1411 1411 1412 def log(sText ):1412 def log(sText, sCaller = None): 1413 1413 """Writes the specfied text to the log.""" 1414 1414 g_oLock.acquire(); 1415 1415 try: 1416 rc = g_oReporter.log(1, sText, utils.getCallerName(), utils.getTimePrefix());1416 rc = g_oReporter.log(1, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1417 1417 except: 1418 1418 rc = -1; … … 1428 1428 return logXcptWorker(1, False, "", sText, cFrames); 1429 1429 1430 def log2(sText ):1430 def log2(sText, sCaller = None): 1431 1431 """Log level 2: Writes the specfied text to the log.""" 1432 1432 g_oLock.acquire(); 1433 1433 try: 1434 rc = g_oReporter.log(2, sText, utils.getCallerName(), utils.getTimePrefix());1434 rc = g_oReporter.log(2, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1435 1435 except: 1436 1436 rc = -1; … … 1446 1446 return logXcptWorker(2, False, "", sText, cFrames); 1447 1447 1448 def log3(sText ):1448 def log3(sText, sCaller = None): 1449 1449 """Log level 3: Writes the specfied text to the log.""" 1450 1450 g_oLock.acquire(); 1451 1451 try: 1452 rc = g_oReporter.log(3, sText, utils.getCallerName(), utils.getTimePrefix());1452 rc = g_oReporter.log(3, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1453 1453 except: 1454 1454 rc = -1; … … 1464 1464 return logXcptWorker(3, False, "", sText, cFrames); 1465 1465 1466 def log4(sText ):1466 def log4(sText, sCaller = None): 1467 1467 """Log level 4: Writes the specfied text to the log.""" 1468 1468 g_oLock.acquire(); 1469 1469 try: 1470 rc = g_oReporter.log(4, sText, utils.getCallerName(), utils.getTimePrefix());1470 rc = g_oReporter.log(4, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1471 1471 except: 1472 1472 rc = -1; … … 1482 1482 return logXcptWorker(4, False, "", sText, cFrames); 1483 1483 1484 def log5(sText ):1484 def log5(sText, sCaller = None): 1485 1485 """Log level 2: Writes the specfied text to the log.""" 1486 1486 g_oLock.acquire(); 1487 1487 try: 1488 rc = g_oReporter.log(5, sText, utils.getCallerName(), utils.getTimePrefix());1488 rc = g_oReporter.log(5, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1489 1489 except: 1490 1490 rc = -1; … … 1500 1500 return logXcptWorker(5, False, "", sText, cFrames); 1501 1501 1502 def log6(sText ):1502 def log6(sText, sCaller = None): 1503 1503 """Log level 6: Writes the specfied text to the log.""" 1504 1504 g_oLock.acquire(); 1505 1505 try: 1506 rc = g_oReporter.log(6, sText, utils.getCallerName(), utils.getTimePrefix());1506 rc = g_oReporter.log(6, sText, sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1507 1507 except: 1508 1508 rc = -1; … … 1521 1521 """ Maybe error or maybe normal log entry. """ 1522 1522 if fIsError is True: 1523 return error(sText );1524 return log(sText );1523 return error(sText, sCaller = utils.getCallerName()); 1524 return log(sText, sCaller = utils.getCallerName()); 1525 1525 1526 1526 def maybeErrXcpt(fIsError, sText=None, cFrames=1): … … 1533 1533 """ Maybe error or maybe normal log entry. """ 1534 1534 if fIsNotError is not True: 1535 return error(sText );1536 return log(sText );1535 return error(sText, sCaller = utils.getCallerName()); 1536 return log(sText, sCaller = utils.getCallerName()); 1537 1537 1538 1538 def maybeLogXcpt(fIsNotError, sText=None, cFrames=1): … … 1542 1542 return logXcpt(sText, cFrames); 1543 1543 1544 def error(sText ):1544 def error(sText, sCaller = None): 1545 1545 """ 1546 1546 Writes the specfied error message to the log. … … 1554 1554 try: 1555 1555 g_oReporter.testIncErrors(); 1556 g_oReporter.log(0, '** error: %s' % (sText), utils.getCallerName(), utils.getTimePrefix());1556 g_oReporter.log(0, '** error: %s' % (sText), sCaller if sCaller else utils.getCallerName(), utils.getTimePrefix()); 1557 1557 except: 1558 1558 pass;
Note:
See TracChangeset
for help on using the changeset viewer.