From 7a997b92850ad24b0a836d7416ff2009bfc6e98d Mon Sep 17 00:00:00 2001 From: David Bariod Date: Mon, 8 Mar 2021 18:02:30 +0100 Subject: [PATCH] improve documentation about timestamp format --- json_formatter.go | 3 +++ text_formatter.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/json_formatter.go b/json_formatter.go index afaf0fc8a..c96dc5636 100644 --- a/json_formatter.go +++ b/json_formatter.go @@ -23,6 +23,9 @@ func (f FieldMap) resolve(key fieldKey) string { // JSONFormatter formats logs into parsable json type JSONFormatter struct { // TimestampFormat sets the format used for marshaling timestamps. + // The format to use is the same than for time.Format or time.Parse from the standard + // library. + // The standard Library already provides a set of predefined format. TimestampFormat string // DisableTimestamp allows disabling automatic timestamps in output diff --git a/text_formatter.go b/text_formatter.go index 8fc698ad6..be2c6efe5 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -53,7 +53,10 @@ type TextFormatter struct { // the time passed since beginning of execution. FullTimestamp bool - // TimestampFormat to use for display when a full timestamp is printed + // TimestampFormat to use for display when a full timestamp is printed. + // The format to use is the same than for time.Format or time.Parse from the standard + // library. + // The standard Library already provides a set of predefined format. TimestampFormat string // The fields are sorted by default for a consistent output. For applications