Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_all_log_data(log_name):
- try:
- print(os.getcwd())
- with open("/home/yakiza/Documents/CroW/crow/log/"+log_name+".log") as myfile:
- lines = myfile.readlines()
- i = 0
- Log_basket = []
- while i < len(lines):
- #regex to capture date and time
- date_capture = re.search(r"([0-9]+\-[0-9]+\-[0-9]+) ([0-9]+\:[0-9]+)", lines[i])
- #regex to capture run, errors and failures
- run_captures = re.search(r"(?<=run=)[0-9]", lines[i])
- errors_captures = re.search(r"(?<=errors=)[0-9]", lines[i])
- failures_captures = re.search(r"(?<=failures=)[0-9]", lines[i])
- for line in lines:
- print(line)
- print(re.search("(?<=errors=)[0-9]",line))
- print(errors_captures)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement