Documentation
¶
Overview ¶
Package fmtlog adds Sprintf-style log messages as a LogLayer plugin. Register it once and every call site that passes a format string followed by arguments gets fmt.Sprintf semantics:
log.AddPlugin(fmtlog.New())
log.Info("user %d signed in", userID)
log.WithMetadata(loglayer.Metadata{"reqId": id}).
Error("request %s failed: %v", id, err)
Without the plugin, multi-argument calls are space-joined (`fmt.Sprintf("%v", arg)` per element). Registering New opts the logger into format-string semantics: any call where the first message is a string and there are extra arguments is rewritten to fmt.Sprintf(messages[0], messages[1:]...) before downstream MessageHooks run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.