Use log.Print* instead of fmt.Print*

This commit is contained in:
Haiyan Meng
2020-01-14 15:50:35 -08:00
parent af131c7471
commit 2e895c147e
6 changed files with 16 additions and 12 deletions

View File

@@ -36,6 +36,7 @@ func main() {
m := entry.(map[string]interface{})
if payload, ok := m["textPayload"]; ok {
// use fmt.Printf here instead of log.Printf to avoid the time and code location info the log package provides
fmt.Printf("%s", payload)
} else {
log.Printf("the log entry does not have the `textPayload` field: %s\n", line)