logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*Service
}

func (*DB) Error

func (d *DB) Error(ctx context.Context, msg string, data ...interface{})

func (*DB) Info

func (d *DB) Info(ctx context.Context, msg string, data ...interface{})

func (*DB) LogMode

func (d *DB) LogMode(logger.LogLevel) logger.Interface

func (*DB) Set

func (d *DB) Set(arg any) services.DBLogger

Set 设置 DBLogger

func (*DB) Trace

func (d *DB) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*DB) Warn

func (d *DB) Warn(ctx context.Context, msg string, data ...interface{})

type Service

type Service struct {
	*zap.Logger
	DBLogger services.DBLogger
}

func New

func New() *Service

New 新建日志服务

func (*Service) DB

func (s *Service) DB() services.DBLogger

DB 获取 DB 的日志输出器

func (*Service) Init

func (s *Service) Init(args ...services.Service) services.Service

Init 初始化 logger

func (*Service) Zap

func (s *Service) Zap() *zap.Logger

Zap 获取 zap logger

Jump to

Keyboard shortcuts

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