pestifer.logparsers.psfgenlogparser module¶
psfgen log parsing utility
- class pestifer.logparsers.psfgenlogparser.PsfgenLogParser(basename='psfgen-logparser')[source]¶
Bases:
LogParserA class for parsing Psfgen log files. This class is a subclass of
LogParserand provides methods for reading, updating, and dumping Psfgen log data.- Parameters:
basename (str) – The base name for the log parser. This is used to name the output log file.
- info_keys = ['Info) ', 'Info: ']¶
A list of prefixes used to identify information lines in the Psfgen log file.
- process_info_line(line: str)[source]¶
Process an information line from the Psfgen log file. This method extracts metadata from the line and updates the metadata attribute accordingly.
- Parameters:
line (str) – A line from the Psfgen log file that contains information to be processed. This can be a string or bytes object containing the log data.
- process_line(line: str)[source]¶
Process a line from the Psfgen log file. This method identifies the type of line (information, Psfgen command) and processes it accordingly.
- Parameters:
line (str) – A line from the Psfgen log file to be processed. This can be a string or bytes object containing the log data.
- process_psfgen_line(line: str)[source]¶
Process a Psfgen-specific line from the log file. This method extracts metadata from the line and updates the metadata attribute accordingly.
- Parameters:
line (str) – A line from the Psfgen log file that contains Psfgen-specific information to be processed. This can be a string or bytes object containing the log data.
- psfgen_key = 'psfgen) '¶
The prefix used to identify Psfgen-specific lines in the log file.
- success()[source]¶
Check if the Psfgen execution was successful. This method checks if the metadata contains the success key, which indicates that the execution was successful.
- Returns:
True if the log parsing was successful, False otherwise.
- Return type:
- update(bytes: str)[source]¶
Update the Psfgen log parser with new bytes of data. This method appends the new bytes to the byte collector and processes the lines in the log file.
- Parameters:
bytes (bytes) – The bytes to update the log parser with. This can be a string or bytes object containing the log data.