-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve documentation about timestamp format
- Loading branch information
David Bariod
committed
Mar 8, 2021
1 parent
f104497
commit 7a997b9
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dgsb
Collaborator
|
||
// library. | ||
// The standard Library already provides a set of predefined format. | ||
TimestampFormat string | ||
|
||
// DisableTimestamp allows disabling automatic timestamps in output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why are we not explicit? and mention
Note: Standard library expects a particular date string value used while formatting i.e. "2006-01-02 15:04:05" that should be strictly followed - you cannot have any other value here. Please refer to standard library time.Format/time.Parse for the details.