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 ## Build Information
- **Version**: 1.1.0 - **Version**: 1.1.0
- **Build Time**: 2025-11-05_13:00:26_UTC - **Build Time**: 2025-11-05_13:06:25_UTC
- **Git Commit**: cea19ca - **Git Commit**: f2f6021
## Recent Updates (v1.1.0) ## Recent Updates (v1.1.0)
- ✅ Fixed TUI progress display with line-by-line output - ✅ 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,24 +227,27 @@ func (f *CleanFormatter) Format(entry *logrus.Entry) ([]byte, error) {
// Column 3: Message // Column 3: Message
output.WriteString(entry.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 { if len(entry.Data) > 0 {
// Only show truly important fields, skip verbose ones
for k, v := range entry.Data { for k, v := range entry.Data {
// Skip noisy internal fields // Skip noisy internal fields and redundant message field
if k == "elapsed" || k == "operation_id" || k == "step" || k == "timestamp" { if k == "elapsed" || k == "operation_id" || k == "step" || k == "timestamp" || k == "message" {
continue continue
} }
// Format duration nicely // Format duration nicely at the end
if k == "duration" { if k == "duration" {
if str, ok := v.(string); ok { if str, ok := v.(string); ok {
output.WriteString(fmt.Sprintf(" [duration: %s]", str)) output.WriteString(fmt.Sprintf(" (%s)", str))
} }
continue continue
} }
// Add other fields // Only show critical fields (driver, errors, etc)
output.WriteString(fmt.Sprintf(" %s=%v", k, v)) if k == "driver" || k == "max_conns" || k == "error" || k == "database" {
output.WriteString(fmt.Sprintf(" %s=%v", k, v))
}
} }
} }