log

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v0.0.2

func Debug(ctx context.Context, msg string, kv ...interface{})

示例 log.Debug(ctx, "调试一下", "order_id", order_id)

func Error added in v0.0.2

func Error(ctx context.Context, msg string, kv ...interface{})

示例 log.Error(ctx, "出错啦", "order_id", order_id)

func Fatal added in v0.0.2

func Fatal(ctx context.Context, msg string, kv ...interface{})

示例 log.Fatal(ctx, "严重错误", "order_id", order_id)

func Info

func Info(ctx context.Context, msg string, kv ...interface{})

示例 log.Info(ctx, "操作成功啦", "order_id", order_id)

func InitDevLogger added in v0.0.2

func InitDevLogger()

func InitPrdLogger added in v0.0.2

func InitPrdLogger()

func Warn added in v0.0.2

func Warn(ctx context.Context, msg string, kv ...interface{})

示例 log.Warn(ctx, "警告", "order_id", order_id)

Types

type LogBasicInfo

type LogBasicInfo struct {
	RequestId string
	Uid       string
}

type Pure added in v0.0.3

type Pure struct{}

用于打印不含上下文信息的,纯日志 因为统一跳过1层调用堆栈信息,所以也必须都包装一层

func (Pure) Debug added in v0.0.3

func (p Pure) Debug(msg string, kv ...interface{})

示例 log.Pure{}.Debug("打日志了", "order_id", order_id)

func (Pure) Error added in v0.0.3

func (p Pure) Error(msg string, kv ...interface{})

示例 log.Pure{}.Error("打日志了", "order_id", order_id)

func (Pure) Fatal added in v0.0.3

func (p Pure) Fatal(msg string, kv ...interface{})

示例 log.Pure{}.Fatal("打日志了", "order_id", order_id)

func (Pure) Info added in v0.0.3

func (p Pure) Info(msg string, kv ...interface{})

示例 log.Pure{}.Info("打日志了", "order_id", order_id)

func (Pure) Warn added in v0.0.3

func (p Pure) Warn(msg string, kv ...interface{})

示例 log.Pure{}.Warn("打日志了", "order_id", order_id)

Jump to

Keyboard shortcuts

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