diff --git a/pkg/cli/gateway_logs.go b/pkg/cli/gateway_logs.go index 8b3362c54e..2026e7c5f6 100644 --- a/pkg/cli/gateway_logs.go +++ b/pkg/cli/gateway_logs.go @@ -140,6 +140,7 @@ func parseGatewayLogs(logDir string, verbose bool) (*GatewayMetrics, error) { // processGatewayLogEntry processes a single log entry and updates metrics func processGatewayLogEntry(entry *GatewayLogEntry, metrics *GatewayMetrics, verbose bool) { + gatewayLogsLog.Printf("Processing gateway log entry: event=%s, server=%s, tool=%s", entry.Event, entry.ServerName, entry.ToolName) // Parse timestamp for time range if entry.Timestamp != "" { if t, err := time.Parse(time.RFC3339, entry.Timestamp); err == nil { @@ -243,6 +244,7 @@ func getOrCreateTool(server *GatewayServerMetrics, toolName string) *GatewayTool // calculateGatewayAggregates calculates aggregate statistics func calculateGatewayAggregates(metrics *GatewayMetrics) { + gatewayLogsLog.Printf("Calculating aggregates for %d servers", len(metrics.Servers)) for _, server := range metrics.Servers { for _, tool := range server.Tools { if tool.CallCount > 0 { @@ -378,6 +380,7 @@ func truncateString(s string, maxLen int) string { // extractMCPToolUsageData creates detailed MCP tool usage data from gateway metrics func extractMCPToolUsageData(logDir string, verbose bool) (*MCPToolUsageData, error) { + gatewayLogsLog.Printf("Extracting MCP tool usage data from: %s", logDir) // Parse gateway logs gatewayMetrics, err := parseGatewayLogs(logDir, verbose) if err != nil { @@ -531,6 +534,7 @@ func extractMCPToolUsageData(logDir string, verbose bool) (*MCPToolUsageData, er // displayAggregatedGatewayMetrics aggregates and displays gateway metrics across all processed runs func displayAggregatedGatewayMetrics(processedRuns []ProcessedRun, outputDir string, verbose bool) { + gatewayLogsLog.Printf("Aggregating gateway metrics from %d processed runs", len(processedRuns)) // Aggregate gateway metrics from all runs aggregated := &GatewayMetrics{ Servers: make(map[string]*GatewayServerMetrics), diff --git a/pkg/cli/interactive.go b/pkg/cli/interactive.go index 77d4e98251..9eb1bb990f 100644 --- a/pkg/cli/interactive.go +++ b/pkg/cli/interactive.go @@ -86,6 +86,7 @@ func CreateWorkflowInteractively(workflowName string, verbose bool, force bool) // promptForWorkflowName asks the user for a workflow name func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error { + interactiveLog.Print("Prompting user for workflow name") form := huh.NewForm( huh.NewGroup( huh.NewInput(). @@ -102,6 +103,7 @@ func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error { // promptForConfiguration organizes all prompts into logical groups with titles and descriptions func (b *InteractiveWorkflowBuilder) promptForConfiguration() error { + interactiveLog.Print("Prompting user for workflow configuration") // Prepare trigger options triggerOptions := []huh.Option[string]{ huh.NewOption("Manual trigger (workflow_dispatch)", "workflow_dispatch"), @@ -287,6 +289,7 @@ func (b *InteractiveWorkflowBuilder) generateWorkflow(force bool) error { // generateWorkflowContent creates the workflow markdown content func (b *InteractiveWorkflowBuilder) generateWorkflowContent() string { + interactiveLog.Printf("Generating workflow content: engine=%s, tools=%v, outputs=%v", b.Engine, b.Tools, b.SafeOutputs) var content strings.Builder // Write frontmatter diff --git a/pkg/cli/trial_repository.go b/pkg/cli/trial_repository.go index 22112adef5..00e529a64a 100644 --- a/pkg/cli/trial_repository.go +++ b/pkg/cli/trial_repository.go @@ -120,6 +120,7 @@ func ensureTrialRepository(repoSlug string, cloneRepoSlug string, forceDeleteHos } func cleanupTrialRepository(repoSlug string, verbose bool) error { + trialRepoLog.Printf("Cleaning up trial repository: %s", repoSlug) if verbose { fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Cleaning up host repository: %s", repoSlug))) } @@ -139,6 +140,7 @@ func cleanupTrialRepository(repoSlug string, verbose bool) error { } func cloneTrialHostRepository(repoSlug string, verbose bool) (string, error) { + trialRepoLog.Printf("Cloning trial host repository: %s", repoSlug) // Create temporary directory tempDir := filepath.Join(os.TempDir(), fmt.Sprintf("gh-aw-trial-%x", time.Now().UnixNano()))