grim/convey

Correctly handle the missing id/idColor

2019-07-28, Gary Kramlich
3e9d186c4b1a
Parents 72bd4b285902
Children 2bd4e1d52ec3
Correctly handle the missing id/idColor
--- a/logging/formatter.go Sun Jul 28 23:01:29 2019 -0500
+++ b/logging/formatter.go Sun Jul 28 23:08:13 2019 -0500
@@ -79,10 +79,10 @@
fmt.Fprintf(b, "[%04d] ", miniTimestamp())
id := entry.Data["id"]
- if id != "" {
+ if id != nil {
idColor := entry.Data["idColor"]
- if f.disableColors && idColor != "" {
+ if f.disableColors && idColor != nil {
fmt.Fprintf(b, "%s: ", id)
} else {
fmt.Fprintf(b, "%s%s%s: ", idColor, id, ansi.Reset)