logger

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogLevel *slog.LevelVar

LogLevel 控制全局日志级别

Functions

func Debug

func Debug(msg string, args ...any)

Debug 打印详细调试信息 (保留 slog 完整上下文,输出至 os.Stderr)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(msg string)

Error 打印错误信息 (纯净格式,红色,输出至 os.Stderr)

func Errorf

func Errorf(format string, args ...any)

func Info

func Info(msg string)

Info 打印常规信息 (纯净格式,无时间戳等,输出至 os.Stdout)

func Infof

func Infof(format string, args ...any)

func Print

func Print(args ...any)

Print 等同于 fmt.Print,但受终端规范管控(预留空间)

func PrintErrorf

func PrintErrorf(format string, args ...any)

PrintErrorf 打印纯净错误信号 (带红色彩色文本修饰,输出给 stderr)

func PrintInfof

func PrintInfof(format string, args ...any)

PrintInfof 打印纯净信息 (带蓝色文本修饰,但无[INFO]此类日志式前缀)

func PrintSuccessf

func PrintSuccessf(format string, args ...any)

PrintSuccessf 打印成功信号 (带绿色彩色文本修饰,无日志式前缀)

func PrintWarnf

func PrintWarnf(format string, args ...any)

PrintWarnf 打印警告信息 (黄色彩色文本修饰,输出给 stderr)

func Printf

func Printf(format string, args ...any)

Printf 等同于 fmt.Printf,无任何前缀和颜色

func SetLogLevel

func SetLogLevel(level string)

SetLogLevel 动态设置日志级别

func Success

func Success(msg string)

Success 打印成功信息 (纯净格式,绿色,输出至 os.Stdout)

func Successf

func Successf(format string, args ...any)

func Warn

func Warn(msg string)

Warn 打印警告信息 (纯净格式,黄色,输出至 os.Stderr)

func Warnf

func Warnf(format string, args ...any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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