Skip to content

Commit

Permalink
docs: context.Timestamp uses zerolog.TimeFieldFormat (rs#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
counterposition authored and mAdkins committed Mar 2, 2024
1 parent a17d09f commit 64d4a0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.go
Expand Up @@ -329,8 +329,9 @@ func (ts timestampHook) Run(e *Event, level Level, msg string) {

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 time format, change zerolog.TimeFieldFormat.
//
// NOTE: It won't dedupe the "time" key if the *Context has one already.
func (c Context) Timestamp() Context {
Expand Down

0 comments on commit 64d4a0e

Please sign in to comment.