Skip to content

Commit

Permalink
Fixing a logging issue (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
dehort authored Sep 5, 2024
1 parent 0103fd8 commit 9fb7aae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/validator/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da
// FIXME: make this configurable
truncateData := len(data) >= 1*1024*1024
if truncateData {
log.Debugw("Payload too big. Truncating payload.")
log.Debug("Payload too big. Truncating payload.")
}

eventTypeCount := make(map[string]int)
Expand Down Expand Up @@ -200,15 +200,15 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da

if validatedEvent.Type == "playbook_run_completed" || validatedEvent.Type == "playbook_run_finished" {
storeEvent = true
log.Debugw("storing run complete/finished for host " /*, *validatedEvent.Host*/)
log.Debug("storing run complete/finished for host " /*, *validatedEvent.Host*/)
}

if validatedEvent.Type == "playbook_run_update" {

if validatedEvent.Host != nil {
if _, ok := hostRunningPlaybook[*validatedEvent.Host]; !ok {
storeEvent = true
log.Debugw("storing run update for host ", *validatedEvent.Host)
log.Debugf("storing run update for host %s", *validatedEvent.Host)
}

hostRunningPlaybook[*validatedEvent.Host]++
Expand All @@ -217,7 +217,7 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da
}

if storeEvent {
log.Debugw("storing event ", validatedEvent.Type)
log.Debugf("storing event %s ", validatedEvent.Type)
events.PlaybookSat = append(events.PlaybookSat, *validatedEvent)
}

Expand All @@ -240,7 +240,7 @@ func (this *handler) validateContent(ctx context.Context, requestType string, da
}

if storeEvent {
log.Debugw("storing event ", validatedEvent.Event)
log.Debugf("storing event %s", validatedEvent.Event)
events.Playbook = append(events.Playbook, *validatedEvent)
}
}
Expand Down

0 comments on commit 9fb7aae

Please sign in to comment.