Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
  • Loading branch information
Wwwsylvia committed Dec 5, 2024
1 parent 512d1e6 commit 050a8e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/trace/text_formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) {

timestamp := entry.Time.Format(time.RFC3339Nano)
levelText := strings.ToUpper(entry.Level.String())
buf.WriteString(fmt.Sprintf("[%s][%s]: %s\n", timestamp, levelText, entry.Message))
fmt.Fprintf(&buf, "[%s][%s]: %s\n", timestamp, levelText, entry.Message)
// printing data fields
if len(entry.Data) != 0 {
buf.WriteString("[Data]:\n")
for k, v := range entry.Data {
buf.WriteString(fmt.Sprintf(" %s=%v\n", k, v))
fmt.Fprintf(&buf, " %s=%v\n", k, v)
}
}

Expand Down

0 comments on commit 050a8e4

Please sign in to comment.