Skip to content

Commit

Permalink
feat: messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Dec 10, 2024
1 parent 0ebc717 commit c4c54eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,11 @@ func watch(filePath string) {
slog.Error("Error scanning file", "error", err.Error(), "filePath", filePath)
return
}
slog.Info("Error count", "count", result.ErrorCount)

slog.Info("1st line", "date", result.FirstDate, "line", pkg.Truncate(result.FirstLine, pkg.TruncateMax))
slog.Info("Preview line", "line", pkg.Truncate(result.PreviewLine, pkg.TruncateMax))
slog.Info("Last line", "date", result.LastDate, "line", pkg.Truncate(result.LastLine, pkg.TruncateMax))
slog.Info("Error percent", "percent", fmt.Sprintf("%.2f", result.ErrorPercent)+"%")
slog.Info("Error count", "percent", fmt.Sprintf("%d (%.2f)", result.ErrorCount, result.ErrorPercent)+"%")

slog.Info("Lines read", "count", result.LinesRead)

slog.Info("Scanning complete", "filePath", result.FilePath)
Expand Down
6 changes: 1 addition & 5 deletions pkg/card.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func GetAlertDetails(f *Flags, version string, result *ScanResult) []gmt.Details
},
{
Label: "Total Errors Found",
Message: fmt.Sprintf("%d", result.ErrorCount),
Message: fmt.Sprintf("%d (%.2f)", result.ErrorCount, result.ErrorPercent) + "%",
},
{
Label: "First Line",
Expand All @@ -118,10 +118,6 @@ func GetAlertDetails(f *Flags, version string, result *ScanResult) []gmt.Details
Label: "Last Line",
Message: Truncate(result.LastLine, TruncateMax),
},
{
Label: "Error Percentage",
Message: fmt.Sprintf("%.2f", result.ErrorPercent) + "%",
},
}
if result.FirstDate != "" || result.LastDate != "" {
details = append(details, gmt.Details{
Expand Down

0 comments on commit c4c54eb

Please sign in to comment.