server_classes::LogFileParser Class Reference

List of all members.

Public Member Functions

def __init__
def _fetch_first_lines
def set_first_lines
def get_first_lines
def test_first_lines
def find_size_last_message_tag
def analyse_log_file
def start_entry
def write_entry
def end_entry
def reset
def _test_keywords
def update_keywords
def update_ignore_error
def _extract_time
def _extract_error_number

Detailed Description

This class provides all the neccessarey tools to parse and work up to logfile of the SRB-System.

Definition at line 136 of file server_classes.py.


Member Function Documentation

def server_classes::LogFileParser::__init__   self,
  logfilepath,
  keywords,
  ignore_error,
  xml_file_path,
  xml_file_name,
  verbose
 

Constructor

Definition at line 139 of file server_classes.py.

def server_classes::LogFileParser::_extract_error_number   self,
  text
 

Thhis function takes a line from the logfile and extract the error number.

Definition at line 553 of file server_classes.py.

def server_classes::LogFileParser::_extract_time   self,
  time_string,
  year
 

This function takes a line from the logfile and extracts the time from there.

Definition at line 538 of file server_classes.py.

def server_classes::LogFileParser::_fetch_first_lines   self,
  file_name
 

This function returns the first 15 lines from current logfile without saving them anywhere.

Definition at line 157 of file server_classes.py.

def server_classes::LogFileParser::_test_keywords   self,
  keywordlist,
  amount_of_keywords,
  teststring
 

This is a recursive function, which tests if a list of keywords is part of a string (AND relation). If all keywords found 0 is returned, otherwise -1

keywordlist = list of all keywords
amount_of_keywords = number of keywords in list
teststring = string, which needs to be investigated

return -1 if line is not interesting
return 0 if line is taken

Definition at line 455 of file server_classes.py.

def server_classes::LogFileParser::analyse_log_file   self,
  parser_file_name,
  file_time = None
 

takes the templog file and goes through each lines and searches for keywords, if keywords are found, the line and the two lines before and after are dumped into a xml file, which the client can collect. This function uses the system function write to create the xml file. The dom function were to ineffectiv and sax unflexible.

parser_file_name = file name of the file, which needs to be parsed

Definition at line 228 of file server_classes.py.

def server_classes::LogFileParser::end_entry   self,
  name
 

This function inserts an end tag into the XML file. (name = tag name)

Definition at line 435 of file server_classes.py.

def server_classes::LogFileParser::find_size_last_message_tag   self,
  fd,
  msg_tag
 

This function find out, how many bytes the last message tag needs. This function was necessary, because this new xml messages have to be added into the client xml file. Since the creating of this file is not very straightforward using known techniques like sax or dom, the last tag gets deleted, the new messages added and the last tag writen again.

fd = file descriptor of the file
msg_tag = message tag to search for

Definition at line 207 of file server_classes.py.

def server_classes::LogFileParser::get_first_lines   self  ) 
 

This function returns the member variable _first_lines.

Definition at line 187 of file server_classes.py.

def server_classes::LogFileParser::reset   self  ) 
 

This function resets member variable, in case of a new log file.

Definition at line 448 of file server_classes.py.

def server_classes::LogFileParser::set_first_lines   self,
  file_name
 

This function saves the first 15 lines of the log file into the member variable.

Definition at line 173 of file server_classes.py.

def server_classes::LogFileParser::start_entry   self,
  name
 

This function inserts a start tag into the XML file. (name = tag name)

Definition at line 384 of file server_classes.py.

def server_classes::LogFileParser::test_first_lines   self,
  file_name
 

This function compares the first 15 lines of a log file and return 0 if they are the same, otherwise -1.

Definition at line 193 of file server_classes.py.

def server_classes::LogFileParser::update_ignore_error   self,
  error
 

This function updates the ignore_error list.

error = new ignore list

Definition at line 530 of file server_classes.py.

def server_classes::LogFileParser::update_keywords   self,
  keys
 

This function updates the member variable keywords.

keys = new keyword list

Definition at line 522 of file server_classes.py.

def server_classes::LogFileParser::write_entry   self,
  tagname,
  content
 

This function inserts an entry into the xml file.

tagname = tag name
content = message between start and end tag

Definition at line 397 of file server_classes.py.


The documentation for this class was generated from the following file:
Generated on Sun Mar 5 18:06:11 2006 for Server by  doxygen 1.4.6-NO