Documentation ¶
Index ¶
- Constants
- func ArgsToAttrs(args *fiber.Args) []slog.Attr
- func GroupAttrs(key string, attrs ...slog.Attr) slog.Attr
- func HeaderToAttrs(header *fasthttp.RequestHeader) []slog.Attr
- func Init(logconf config.Log) error
- func New(logConf config.Log) (*slog.Logger, error)
- func NewLumberjackWriter(logconf config.Log) (io.Writer, error)
- func NewWrite(logconf config.Log) (io.Writer, error)
- type MetaHandler
Constants ¶
View Source
const ( TraceIDKey = "trace_id" UserIDKey = "user_id" )
Variables ¶
This section is empty.
Functions ¶
func ArgsToAttrs ¶
ArgsToAttrs 将 fiber url 的参数转换为 slog.Attr
func GroupAttrs ¶
GroupAttrs 将多个 Attr 组合成一个 Attr
func HeaderToAttrs ¶
func HeaderToAttrs(header *fasthttp.RequestHeader) []slog.Attr
HeaderToAttrs 将 fiber header 的参数转换为 slog.Attr
func NewLumberjackWriter ¶
NewLumberjackWriter 获取滚动写入日志 writer
Types ¶
type MetaHandler ¶
type MetaHandler struct {
// contains filtered or unexported fields
}
func NewMetaHandler ¶
func NewMetaHandler(handler slog.Handler) *MetaHandler
func (*MetaHandler) Enabled ¶
Enabled reports whether the handler handles records at the given level.
Click to show internal directories.
Click to hide internal directories.