Browse Source

set tz t example

pull/15/head
andrey 12 months ago
parent
commit
9cd8f95c73
  1. 6
      writer_example_test.go

6
writer_example_test.go

@ -14,7 +14,7 @@ import (
func exampleWithTime(key, format string) log.Middleware {
return func(ctx context.Context, e *entry.Entry, handler log.Logger) (int, error) {
return handler(ctx, e.Add(field.FormatTime(key, format, time.Unix(math.MaxInt32, 0))))
return handler(ctx, e.Add(field.FormatTime(key, format, time.Unix(math.MaxInt32, 0).In(time.UTC))))
}
}
@ -32,6 +32,6 @@ func ExampleFormatWithBracket() {
serviceLogger := logger.With(log.WithName("service_name"))
serviceLogger.Err(ctx, "error message")
// Output:
// 2038-01-19T06:14:07+03:00 [info] writer_example_test.go:30 "imfo message" num=42
// 2038-01-19T06:14:07+03:00 [error][service_name] writer_example_test.go:33 "error message"
// 2038-01-19T03:14:07Z [info] writer_example_test.go:30 "imfo message" num=42
// 2038-01-19T03:14:07Z [error][service_name] writer_example_test.go:33 "error message"
}

Loading…
Cancel
Save