Skip to content

Commit

Permalink
docs: context.Timestamp uses zerolog.TimeFieldFormat (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
counterposition authored Jun 11, 2023
1 parent 4612e09 commit b662f08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
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 b662f08

Please sign in to comment.