Read and display a specific log file. Args: filename: The log filename to read
(filename: str)
| 143 | |
| 144 | |
| 145 | def read_log_file(filename: str) -> None: |
| 146 | """Read and display a specific log file. |
| 147 | |
| 148 | Args: |
| 149 | filename: The log filename to read |
| 150 | """ |
| 151 | log_dir = get_log_directory() |
| 152 | log_file = log_dir / filename |
| 153 | |
| 154 | if not log_file.exists() or not log_file.is_file(): |
| 155 | print(f"\n{Colors.RED}❌ Log file not found: {log_file}{Colors.RESET}\n") |
| 156 | return |
| 157 | |
| 158 | print(f"\n{Colors.BRIGHT_CYAN}📄 Reading: {log_file}{Colors.RESET}") |
| 159 | print(f"{Colors.DIM}{'─' * 80}{Colors.RESET}") |
| 160 | |
| 161 | try: |
| 162 | with open(log_file, "r", encoding="utf-8") as f: |
| 163 | content = f.read() |
| 164 | print(content) |
| 165 | print(f"{Colors.DIM}{'─' * 80}{Colors.RESET}") |
| 166 | print(f"\n{Colors.GREEN}✅ End of file{Colors.RESET}\n") |
| 167 | except Exception as e: |
| 168 | print(f"\n{Colors.RED}❌ Error reading file: {e}{Colors.RESET}\n") |
| 169 | |
| 170 | |
| 171 | def print_banner(): |
no test coverage detected