MCPcopy
hub / github.com/rs/zerolog / Timestamp

Method Timestamp

context.go:406–409  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

404//
405// NOTE: It won't dedupe the "time" key if the *Context has one already.
406func (c Context) Timestamp() Context {
407 c.l = c.l.Hook(th)
408 return c
409}
410
411// Time adds the field key with t formatted as string using zerolog.TimeFieldFormat.
412func (c Context) Time(key string, t time.Time) Context {

Callers 1

RunMethod · 0.45

Calls 1

HookMethod · 0.80

Tested by

no test coverage detected