ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
python.trfValidation.scriptLogFileReport Class Reference
Inheritance diagram for python.trfValidation.scriptLogFileReport:
Collaboration diagram for python.trfValidation.scriptLogFileReport:

Public Member Functions

def __init__ (self, logfile=None, msgLimit=200, msgDetailLevel=stdLogLevels['ERROR'])
 
def resetReport (self)
 
def scanLogFile (self, resetReport=False)
 
def worstError (self)
 
def __str__ (self)
 
def rootSysErrorParser (self, line, lineCounter)
 
def scanLogFile (self)
 
def firstError (self)
 

Private Attributes

 _levelCounter
 
 _errorDetails
 
 _logfile
 
 _msgLimit
 
 _msgDetails
 
 _re
 

Detailed Description

Definition at line 677 of file trfValidation.py.

Constructor & Destructor Documentation

◆ __init__()

def python.trfValidation.scriptLogFileReport.__init__ (   self,
  logfile = None,
  msgLimit = 200,
  msgDetailLevel = stdLogLevels['ERROR'] 
)

Reimplemented from python.trfValidation.logFileReport.

Definition at line 678 of file trfValidation.py.

678  def __init__(self, logfile=None, msgLimit=200, msgDetailLevel=stdLogLevels['ERROR']):
679  self._levelCounter = {}
680  self._errorDetails = {}
681  self.resetReport()
682  super(scriptLogFileReport, self).__init__(logfile, msgLimit, msgDetailLevel)
683 

Member Function Documentation

◆ __str__()

def python.trfValidation.scriptLogFileReport.__str__ (   self)

Reimplemented from python.trfValidation.logFileReport.

Definition at line 732 of file trfValidation.py.

732  def __str__(self):
733  return str(self._levelCounter) + str(self._errorDetails)
734 

◆ firstError()

def python.trfValidation.logFileReport.firstError (   self)
inherited

Definition at line 201 of file trfValidation.py.

201  def firstError(self):
202  pass
203 

◆ resetReport()

def python.trfValidation.scriptLogFileReport.resetReport (   self)

Reimplemented from python.trfValidation.logFileReport.

Definition at line 684 of file trfValidation.py.

684  def resetReport(self):
685  self._levelCounter.clear()
686  for level in list(stdLogLevels) + ['UNKNOWN', 'IGNORED']:
687  self._levelCounter[level] = 0
688 
689  self._errorDetails.clear()
690  for level in self._levelCounter: # List of dicts {'message': errMsg, 'firstLine': lineNo, 'count': N}
691  self._errorDetails[level] = []
692 

◆ rootSysErrorParser()

def python.trfValidation.scriptLogFileReport.rootSysErrorParser (   self,
  line,
  lineCounter 
)

Definition at line 735 of file trfValidation.py.

735  def rootSysErrorParser(self, line, lineCounter):
736  msg.debug('Identified ROOT IO problem - adding to error detail report')
737  self._levelCounter['FATAL'] += 1
738  self._errorDetails['FATAL'].append({'message': line, 'firstLine': lineCounter, 'count': 1})
739 

◆ scanLogFile() [1/2]

def python.trfValidation.logFileReport.scanLogFile (   self)
inherited

Definition at line 195 of file trfValidation.py.

195  def scanLogFile(self):
196  pass
197 

◆ scanLogFile() [2/2]

def python.trfValidation.scriptLogFileReport.scanLogFile (   self,
  resetReport = False 
)

Definition at line 693 of file trfValidation.py.

693  def scanLogFile(self, resetReport=False):
694  if resetReport:
695  self.resetReport()
696 
697  for log in self._logfile:
698  msg.info('Scanning logfile {0}'.format(log))
699  try:
700  myGen = trfUtils.lineByLine(log)
701  except IOError as e:
702  msg.error('Failed to open transform logfile {0}: {1:s}'.format(log, e))
703  # Return this as a small report
704  self._levelCounter['ERROR'] = 1
705  self._errorDetails['ERROR'] = {'message': str(e), 'firstLine': 0, 'count': 1}
706  return
707 
708  for line, lineCounter in myGen:
709  # TODO: This implementation currently only scans for Root SysErrors.
710  # General solution would be a have common error parser for all system level
711  # errors those all also handled by AthenaLogFileReport.
712  if line.__contains__('Error in <TFile::ReadBuffer>') or \
713  line.__contains__('Error in <TFile::WriteBuffer>'):
714  self.rootSysErrorParser(line, lineCounter)
715 

◆ worstError()

def python.trfValidation.scriptLogFileReport.worstError (   self)

Reimplemented from python.trfValidation.logFileReport.

Definition at line 717 of file trfValidation.py.

717  def worstError(self):
718  worstlevelName = 'DEBUG'
719  worstLevel = stdLogLevels[worstlevelName]
720  for levelName, count in self._levelCounter.items():
721  if count > 0 and stdLogLevels.get(levelName, 0) > worstLevel:
722  worstlevelName = levelName
723  worstLevel = stdLogLevels[levelName]
724 
725  if len(self._errorDetails[worstlevelName]) > 0:
726  firstError = self._errorDetails[worstlevelName][0]
727  else:
728  firstError = None
729 
730  return {'level': worstlevelName, 'nLevel': worstLevel, 'firstError': firstError}
731 

Member Data Documentation

◆ _errorDetails

python.trfValidation.scriptLogFileReport._errorDetails
private

Definition at line 680 of file trfValidation.py.

◆ _levelCounter

python.trfValidation.scriptLogFileReport._levelCounter
private

Definition at line 679 of file trfValidation.py.

◆ _logfile

python.trfValidation.logFileReport._logfile
privateinherited

Definition at line 181 of file trfValidation.py.

◆ _msgDetails

python.trfValidation.logFileReport._msgDetails
privateinherited

Definition at line 186 of file trfValidation.py.

◆ _msgLimit

python.trfValidation.logFileReport._msgLimit
privateinherited

Definition at line 185 of file trfValidation.py.

◆ _re

python.trfValidation.logFileReport._re
privateinherited

Definition at line 187 of file trfValidation.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
str
Definition: BTagTrackIpAccessor.cxx:11