Skip to content

Commit

Permalink
Support go-1.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
paramite committed Aug 21, 2019
1 parent 1d59491 commit 13f6f34
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions logging/logger.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package logging

import (
"bytes"
"fmt"
"os"
"strings"
"time"
)

Expand Down Expand Up @@ -51,7 +51,9 @@ func (self *Logger) Metadata(metadata map[string]interface{}) {
}

func (self *Logger) formatMetadata() (string, error) {
var build strings.Builder
//var build strings.Builder
// Note: we need to support go-1.9.2 because of CentOS7
var build bytes.Buffer
if len(self.metadata) > 0 {
joiner := ""
for key, item := range self.metadata {
Expand All @@ -75,7 +77,9 @@ func (self *Logger) writeRecord(level LogLevel, message string) error {
return err
}

var build strings.Builder
//var build strings.Builder
// Note: we need to support go-1.9.2 because of CentOS7
var build bytes.Buffer
if self.Timestamp {
_, err = build.WriteString(time.Now().Format("2006-01-02 15:04:05 "))
}
Expand Down

0 comments on commit 13f6f34

Please sign in to comment.