Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/pkg/resolve/logfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func NewLogFactory(data []byte, opts ...OptT) (format.FactoryI, int64, error) {
}

if err != nil {
log.Error().Err(err).Msg("Failed to detect timestamp format")
return nil, 0, err
}

Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/timez/timez.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ func TryTimestampFormat(exp string, fmtStr TimestampFmt, buf []byte, maxTries in
Msg("Trying timestamp format")

if cb, err = GetTimestampFormat(fmtStr); err != nil {
log.Error().Err(err).Msg("Failed to get timestamp format")
log.Warn().Err(err).Msg("Failed to get timestamp format")
return nil, 0, err
}

if factory, err = format.NewRegexFactory(exp, cb); err != nil {
log.Error().Err(err).Msg("Failed to create regex factory")
log.Warn().Err(err).Msg("Failed to create regex factory")
return nil, 0, err
}

Expand All @@ -137,7 +137,7 @@ func TryTimestampFormat(exp string, fmtStr TimestampFmt, buf []byte, maxTries in
}

if err != nil {
log.Info().Err(err).Msg("Failed to read timestamp")
log.Warn().Err(err).Msg("Failed to read timestamp")
return nil, 0, err
}

Expand Down
9 changes: 8 additions & 1 deletion internal/pkg/ux/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ const (
sevHigh = "high"
sevMedium = "medium"
sevLow = "low"
sevInfo = "info"
colorCritical = text.FgHiRed
colorHigh = text.FgHiYellow
colorMedium = text.FgHiMagenta
colorLow = text.FgHiGreen
colorInfo = text.FgHiBlue
reportFmt = "preq-report-%d.json"
)

Expand All @@ -42,7 +44,7 @@ const (
)

var (
sevWidth = max(len(sevCritical), len(sevHigh), len(sevMedium), len(sevLow))
sevWidth = max(len(sevCritical), len(sevHigh), len(sevMedium), len(sevLow), len(sevInfo))
retries = uint(3)
delay = time.Second * 5
)
Expand Down Expand Up @@ -143,6 +145,11 @@ func getSeverity(severity uint) (*severityT, error) {
severity: sevLow,
color: colorLow,
}, nil
case parser.SeverityInfo:
return &severityT{
severity: sevInfo,
color: colorInfo,
}, nil
}

return nil, ErrInvalidSeverity
Expand Down