Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() *slog.Logger

Default 返回开发环境默认日志器:文本格式、Debug 级别,同时写到 stderr 和数据目录下的 goink.log。 文件日志自动轮转:单文件 10MB,保留 3 个备份,超过 30 天自动删除。 stderr 写入失败(如 Windows GUI 无控制台)不影响文件日志。

func New

func New(level slog.Level, format string, out io.Writer) *slog.Logger

New 创建结构化日志器。

format: "text"(开发环境)或 "json"(生产环境)
level:  slog.LevelDebug / Info / Warn / Error
out:    os.Stdout、os.Stderr 或文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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