docs: context.Timestamp uses zerolog.TimeFieldFormat (#554)
This commit is contained in:
parent
4612e098d2
commit
b662f088b9
|
@ -329,8 +329,9 @@ func (ts timestampHook) Run(e *Event, level Level, msg string) {
|
||||||
|
|
||||||
var th = timestampHook{}
|
var th = timestampHook{}
|
||||||
|
|
||||||
// Timestamp adds the current local time as UNIX timestamp to the logger context with the "time" key.
|
// Timestamp adds the current local time to the logger context with the "time" key, formatted using zerolog.TimeFieldFormat.
|
||||||
// To customize the key name, change zerolog.TimestampFieldName.
|
// To customize the key name, change zerolog.TimestampFieldName.
|
||||||
|
// To customize the time format, change zerolog.TimeFieldFormat.
|
||||||
//
|
//
|
||||||
// NOTE: It won't dedupe the "time" key if the *Context has one already.
|
// NOTE: It won't dedupe the "time" key if the *Context has one already.
|
||||||
func (c Context) Timestamp() Context {
|
func (c Context) Timestamp() Context {
|
||||||
|
|
Loading…
Reference in New Issue