feat(log): default message key (#1545)

pull/1546/head
letian 3 years ago committed by GitHub
parent 1e86faea1b
commit 3d23d295c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      log/helper.go

@ -6,6 +6,8 @@ import (
"os" "os"
) )
var DefaultMessageKey = "msg"
// Option is Helper option. // Option is Helper option.
type Option func(*Helper) type Option func(*Helper)
@ -24,7 +26,7 @@ func WithMessageKey(k string) Option {
// NewHelper new a logger helper. // NewHelper new a logger helper.
func NewHelper(logger Logger, opts ...Option) *Helper { func NewHelper(logger Logger, opts ...Option) *Helper {
options := &Helper{ options := &Helper{
msgKey: "msg", // default message key msgKey: DefaultMessageKey, // default message key
logger: logger, logger: logger,
} }
for _, o := range opts { for _, o := range opts {

Loading…
Cancel
Save