MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / read_log_file

Function read_log_file

mini_agent/cli.py:145–168  ·  view source on GitHub ↗

Read and display a specific log file. Args: filename: The log filename to read

(filename: str)

Source from the content-addressed store, hash-verified

143
144
145def 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
171def print_banner():

Callers 2

run_agentFunction · 0.85
mainFunction · 0.85

Calls 1

get_log_directoryFunction · 0.85

Tested by

no test coverage detected