MCPcopy Create free account
hub / github.com/github/gh-aw / parseAgentLogIfRequested

Function parseAgentLogIfRequested

pkg/cli/audit.go:891–910  ·  view source on GitHub ↗
(runID int64, runOutputDir string, verbose bool)

Source from the content-addressed store, hash-verified

889}
890
891func parseAgentLogIfRequested(runID int64, runOutputDir string, verbose bool) {
892 awInfoPath := filepath.Join(runOutputDir, "aw_info.json")
893 engine := extractEngineFromAwInfo(awInfoPath, verbose)
894 if engine == nil {
895 if verbose {
896 fmt.Fprintln(os.Stderr, console.FormatInfoMessage("No engine detected (aw_info.json missing or invalid); skipping agent log rendering"))
897 }
898 return
899 }
900 if err := parseAgentLog(runOutputDir, engine, verbose); err != nil {
901 if verbose {
902 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Failed to parse agent log for run %d: %v", runID, err)))
903 }
904 return
905 }
906 logMdPath := filepath.Join(runOutputDir, "log.md")
907 if fileutil.FileExists(logMdPath) {
908 fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("✓ Parsed log for run %d → %s", runID, logMdPath)))
909 }
910}
911
912func parseFirewallLogsIfRequested(runID int64, runOutputDir string, verbose bool) {
913 if err := parseFirewallLogs(runOutputDir, verbose); err != nil {

Callers 1

Calls 6

FormatInfoMessageFunction · 0.92
FormatWarningMessageFunction · 0.92
FileExistsFunction · 0.92
FormatSuccessMessageFunction · 0.92
extractEngineFromAwInfoFunction · 0.85
parseAgentLogFunction · 0.85

Tested by

no test coverage detected