Skip to content

Commit 7a997b9

Browse files
author
David Bariod
committed
improve documentation about timestamp format
1 parent f104497 commit 7a997b9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

json_formatter.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (f FieldMap) resolve(key fieldKey) string {
2323
// JSONFormatter formats logs into parsable json
2424
type JSONFormatter struct {
2525
// TimestampFormat sets the format used for marshaling timestamps.
26+
// The format to use is the same than for time.Format or time.Parse from the standard
27+
// library.
28+
// The standard Library already provides a set of predefined format.
2629
TimestampFormat string
2730

2831
// DisableTimestamp allows disabling automatic timestamps in output

text_formatter.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ type TextFormatter struct {
5353
// the time passed since beginning of execution.
5454
FullTimestamp bool
5555

56-
// TimestampFormat to use for display when a full timestamp is printed
56+
// TimestampFormat to use for display when a full timestamp is printed.
57+
// The format to use is the same than for time.Format or time.Parse from the standard
58+
// library.
59+
// The standard Library already provides a set of predefined format.
5760
TimestampFormat string
5861

5962
// The fields are sorted by default for a consistent output. For applications

0 commit comments

Comments
 (0)