Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
crossRT committed Nov 29, 2024
1 parent c0d339c commit 15a715e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions internal/model1/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ func (h Header) MapIndices(cols []string, wide bool) ([]int, ExtractionInfoBag)

for _, col := range cols {
idx, ok := h.IndexOf(col, true)
if !ok {
log.Warn().Msgf("Column %q not found on resource", col)
}

ii, cc[idx] = append(ii, idx), struct{}{}

// If the column already found OR the it doesn't match the regex
if ok || !regex.MatchString(col) {
// Continue to next iteration if the column is found
if ok {
continue
}

log.Warn().Msgf("Column %q not found on resource", col)

// Continue to next iteration ff the column doesn't match the regex
if !regex.MatchString(col) {
log.Warn().Msgf("Column %q doesn't match regex pattern", col)
continue
}

Expand All @@ -103,9 +109,11 @@ func (h Header) MapIndices(cols []string, wide bool) ([]int, ExtractionInfoBag)

// now only support LABELS
if headerName != "LABELS" {
log.Warn().Msgf("Custom Column %q is not supported", col)
continue
}

log.Warn().Msgf("Custom column %q is extracting value with header name: %q and key: %q", col, headerName, key)
currentIdx := len(ii) - 1
idxInFields, _ := h.IndexOf(headerName, true)
eib[currentIdx] = ExtractionInfo{idxInFields, headerName, key}
Expand Down

0 comments on commit 15a715e

Please sign in to comment.