| 10823 | 'comment.py - INFO - Comments loaded successfully from cache', |
| 10824 | ) |
| 10825 | if noise_filters: |
| 10826 | all_logs = [ |
| 10827 | log for log in all_logs |
| 10828 | if not any(noise in log for noise in noise_filters) |
| 10829 | ] |
| 10830 | |
| 10831 | # Sort logs chronologically if they have timestamps |
| 10832 | # Logs are in format: YYYY-MM-DD HH:MM:SS - filename - LEVEL - message |
| 10833 | def extract_timestamp(log_line): |
| 10834 | try: |
| 10835 | # Extract timestamp from log line (first 19 characters: YYYY-MM-DD HH:MM:SS) |
| 10836 | if len(log_line) >= 19 and log_line[4] == '-' and log_line[7] == '-': |
| 10837 | timestamp_str = log_line[:19] |
| 10838 | from datetime import datetime |
| 10839 | return datetime.strptime(timestamp_str, '%Y-%m-%d %H:%M:%S') |
| 10840 | except: |
| 10841 | pass |
| 10842 | return datetime.min |
| 10843 | |
| 10844 | # Sort by timestamp |
| 10845 | try: |
| 10846 | from datetime import datetime |