From 4a61b678cf4ad3390023eb97b9b34c33099f621e Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 3 Jan 2024 21:20:41 +0300 Subject: [PATCH] add eample log time --- writer_example_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/writer_example_test.go b/writer_example_test.go index f54188b..c16036c 100644 --- a/writer_example_test.go +++ b/writer_example_test.go @@ -22,7 +22,8 @@ func ExampleFormatWithBracket() { ctx := context.Background() logger := log.New(log.WithFormat(log.FormatWithBracket()), log.WithStdout()).With( log.WithSource(10, filepath.Base), - + // log.WithTime(log.KeyTime, time.RFC3339), + exampleWithTime(log.KeyTime, time.RFC3339), log.WithLevel(log.KeyLevel, level.Info), ) @@ -31,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:29 "imfo message" num=42 - // 2038-01-19T06:14:07+03:00 [error][service_name] writer_example_test.go:32 "error message" + // 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" }