Update logging.go

Prevent attempting to directly print strings that may contain embedded percent characters.
This commit is contained in:
davidjmccann
2022-09-12 09:43:59 +01:00
parent 3adb91d9bb
commit bfd37e39c5

View File

@@ -1,5 +1,5 @@
/* /*
© Copyright IBM Corporation 2017, 2021 © Copyright IBM Corporation 2017, 2022
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@@ -165,7 +165,7 @@ func configureLogger(name string) (mirrorFunc, error) {
if err != nil { if err != nil {
log.Printf("Failed to unmarshall JSON in log message - %v", err) log.Printf("Failed to unmarshall JSON in log message - %v", err)
} else { } else {
fmt.Printf(formatBasic(obj)) fmt.Print(formatBasic(obj))
} }
} else { } else {
// The log being mirrored isn't JSON, so just print it. // The log being mirrored isn't JSON, so just print it.