Class of patterns that can be ignored from athena logfiles.
More...
Class of patterns that can be ignored from athena logfiles.
Definition at line 100 of file trfValidation.py.
◆ __init__()
def python.trfValidation.ignorePatterns.__init__ |
( |
|
self, |
|
|
|
files = ['atlas_error_mask.db'] , |
|
|
|
extraSearch = [] |
|
) |
| |
Load error patterns from files.
Load regular expressions to be used in logfile parsing Files to load up structured error patterns from
- Parameters
-
extraSearch | Extra regexp strings to search against |
Definition at line 106 of file trfValidation.py.
106 def __init__(self, files=['atlas_error_mask.db'], extraSearch = []):
108 self._structuredPatterns = []
109 self._initalisePatterns(files)
112 self._searchPatterns = []
113 self._initialiseSerches(extraSearch)
◆ _initalisePatterns()
def python.trfValidation.ignorePatterns._initalisePatterns |
( |
|
self, |
|
|
|
files |
|
) |
| |
|
private |
Definition at line 123 of file trfValidation.py.
123 def _initalisePatterns(self, files):
124 for patternFile
in files:
125 if patternFile ==
"None":
127 fullName = trfUtils.findFile(os.environ[
'DATAPATH'], patternFile)
129 msg.warning(
'Error pattern file {0} could not be found in DATAPATH'.
format(patternFile))
132 with open(fullName)
as patternFileHandle:
133 msg.debug(
'Opened error file {0} from here: {1}'.
format(patternFile, fullName))
135 for line
in patternFileHandle:
137 if line.startswith(
'#')
or line ==
'':
141 (who, level, message) = [ s.strip()
for s
in line.split(
',', 2) ]
145 reWho = re.compile(who)
146 reMessage = re.compile(message)
148 msg.warning(
'Could not parse this line as a valid error pattern: {0}'.
format(line))
150 except re.error
as e:
151 msg.warning(
'Could not parse valid regexp from {0}: {1}'.
format(message, e))
154 msg.debug(
'Successfully parsed: who={0}, level={1}, message={2}'.
format(who, level, message))
156 self._structuredPatterns.
append({
'service': reWho,
'level': level,
'message': reMessage})
158 except OSError
as xxx_todo_changeme:
159 (errno, errMsg) = xxx_todo_changeme.args
160 msg.warning(
'Failed to open error pattern file {0}: {1} ({2})'.
format(fullName, errMsg, errno))
◆ _initialiseSerches()
def python.trfValidation.ignorePatterns._initialiseSerches |
( |
|
self, |
|
|
|
searchStrings = [] |
|
) |
| |
|
private |
Definition at line 163 of file trfValidation.py.
163 def _initialiseSerches(self, searchStrings=[]):
164 for string
in searchStrings:
166 self._searchPatterns.
append(re.compile(string))
167 msg.debug(
'Successfully parsed additional logfile search string: {0}'.
format(string))
168 except re.error
as e:
169 msg.warning(
'Could not parse valid regexp from {0}: {1}'.
format(string, e))
◆ searchPatterns()
def python.trfValidation.ignorePatterns.searchPatterns |
( |
|
self | ) |
|
Definition at line 120 of file trfValidation.py.
120 def searchPatterns(self):
121 return self._searchPatterns
◆ structuredPatterns()
def python.trfValidation.ignorePatterns.structuredPatterns |
( |
|
self | ) |
|
Definition at line 116 of file trfValidation.py.
116 def structuredPatterns(self):
117 return self._structuredPatterns
◆ _searchPatterns
python.trfValidation.ignorePatterns._searchPatterns |
|
private |
◆ _structuredPatterns
python.trfValidation.ignorePatterns._structuredPatterns |
|
private |
The documentation for this class was generated from the following file: