logging

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "logging"

Variables

This section is empty.

Functions

func Component

func Component(name string, fields ...zap.Field) *namedLogger

Component 命名的log

func CreateCtx

func CreateCtx(ctx context.Context, logger *zap.Logger) context.Context

CreateCtx create context with logger

func GetLog

func GetLog(ctx context.Context) *zap.Logger

GetLog get log from context

从context中获取log, log会带上注入的字段

func L

func L() *zap.Logger

L global zap log

func S

func S() *zap.SugaredLogger

S global zap sugared log

Types

type Logger

type Logger = zap.Logger

func New

func New(c config.Config) *Logger

New logger

func NewWithCfg

func NewWithCfg(cfg *log_config.Config) *Logger

Directories

Path Synopsis
log_ext

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL