log

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 10 Imported by: 4

Documentation

Overview

Package log provide global singleton object access

Index

Constants

View Source
const (
	ModeDebug   = "debug"   // 打印所有日志
	ModeRelease = "release" // 仅打印info及以上级别的日志
)

日志模式

Variables

View Source
var (
	Logger *zap.SugaredLogger
)

Functions

func Debug

func Debug(ctx context.Context, tpl string, args ...interface{})

Debug 增加了记录trace id

func Error

func Error(ctx context.Context, tpl string, args ...interface{})

Error 增加了记录trace id

func FlushLogger

func FlushLogger()

func Info

func Info(ctx context.Context, tpl string, args ...interface{})

Info 增加了记录trace id

func IsDebugMode added in v0.1.3

func IsDebugMode() bool

IsDebugMode 是否是debug模式,是返回true

func SetLevel

func SetLevel(mode ...string)

SetLevel 设置日志级别

func Warn

func Warn(ctx context.Context, tpl string, args ...interface{})

Warn 增加了记录trace id

Types

This section is empty.

Jump to

Keyboard shortcuts

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