def get_log_entries(log_files): combined_log = [] total_lines, line_limit = 0, 100 for file in log_files: if (file.endswith('temp')): continue log_entries = tail_file(file, line_count=100) for line in log_entries: total_lines += 1 if total_lines >= line_limit: break epoch, log_message = line.split('|') date_time = System.calculate_time_offset(int(epoch)) date_time = System.format_log_time(date_time) combined_log.append((date_time, log_message)) return combined_log
def get_log_entries(log_files): combined_log = [] total_lines, line_limit = 0, 100 for file in log_files: if (file.endswith('temp')): continue log_entries = tail_file(file, line_count=100) for line in log_entries: # skipping over empty lines. if not line.strip('\n'): continue total_lines += 1 if total_lines >= line_limit: break epoch, *log_entry = line.split('|', 3) date_time = System.calculate_time_offset(int(epoch)) date_time = System.format_log_time(date_time) combined_log.append((date_time, *log_entry)) return combined_log