fix: clean log formatter - remove message field redundancy

This commit is contained in:
2025-11-05 13:07:17 +00:00
parent f2f6021996
commit 161f577c3a
13 changed files with 12 additions and 9 deletions

View File

@ -4,8 +4,8 @@ This directory contains pre-compiled binaries for the DB Backup Tool across mult
## Build Information
- **Version**: 1.1.0
- **Build Time**: 2025-11-05_13:00:26_UTC
- **Git Commit**: cea19ca
- **Build Time**: 2025-11-05_13:06:25_UTC
- **Git Commit**: f2f6021
## Recent Updates (v1.1.0)
- ✅ Fixed TUI progress display with line-by-line output

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
dbbackup

Binary file not shown.

View File

@ -227,26 +227,29 @@ func (f *CleanFormatter) Format(entry *logrus.Entry) ([]byte, error) {
// Column 3: Message
output.WriteString(entry.Message)
// Append important fields in a clean format (skip internal fields)
// Append important fields in a clean format (skip internal/redundant fields)
if len(entry.Data) > 0 {
// Only show truly important fields, skip verbose ones
for k, v := range entry.Data {
// Skip noisy internal fields
if k == "elapsed" || k == "operation_id" || k == "step" || k == "timestamp" {
// Skip noisy internal fields and redundant message field
if k == "elapsed" || k == "operation_id" || k == "step" || k == "timestamp" || k == "message" {
continue
}
// Format duration nicely
// Format duration nicely at the end
if k == "duration" {
if str, ok := v.(string); ok {
output.WriteString(fmt.Sprintf(" [duration: %s]", str))
output.WriteString(fmt.Sprintf(" (%s)", str))
}
continue
}
// Add other fields
// Only show critical fields (driver, errors, etc)
if k == "driver" || k == "max_conns" || k == "error" || k == "database" {
output.WriteString(fmt.Sprintf(" %s=%v", k, v))
}
}
}
output.WriteString("\n")
return []byte(output.String()), nil