Skip to content

Commit

Permalink
Swap timestamp and prefix to follow common semantics
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 697000549
  • Loading branch information
ChaitanyaKulkarni28 authored and copybara-github committed Nov 15, 2024
1 parent 80f1ba8 commit 41950de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions galog_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func NewFileBackend(logFilePath string) *FileBackend {
}

res.config.SetFormat(ErrorLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: {{.Message}}`)
res.config.SetFormat(DebugLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)

return res
}
Expand Down
4 changes: 2 additions & 2 deletions galog_serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func NewSerialBackend(ctx context.Context, opts *SerialOptions) *SerialBackend {
}

res.config.SetFormat(ErrorLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: {{.Message}}`)
res.config.SetFormat(DebugLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)

return res
}
Expand Down
4 changes: 2 additions & 2 deletions galog_stderr.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ func NewStderrBackend(writer io.Writer) *StderrBackend {
}

res.config.SetFormat(ErrorLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: {{.Message}}`)
res.config.SetFormat(DebugLevel,
`{{if .Prefix}}{{.Prefix}}: {{end}}{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} [{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)
`{{.When.Format "2006-01-02T15:04:05.0000Z07:00"}} {{if .Prefix}} {{.Prefix}}: {{end}}[{{.Level}}]: ({{.File}}:{{.Line}}) {{.Message}}`)

return res
}
Expand Down

0 comments on commit 41950de

Please sign in to comment.