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

proclog

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package proclog 进程级日志初始化与失败退出。

公网壳(git-ferry)与内网壳(git-ferry-intranet)此前各自复制了一份逐字相同的 实现;两者都依赖 core,故收敛到这里。core 自身不调用本包(库不应决定宿主进程 的日志与退出行为)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitOnFail

func ExitOnFail(msg string, err error)

ExitOnFail 打日志并退出进程(启动期不可恢复错误用)。

func Setup

func Setup(level, format string)

Setup 按 level/format 配置默认 slog(level: debug|info|warn|error;format: text|json), 并把进程内 oekit 组件接到同一套输出:

  • async.GoSafe 恢复的 panic 经 slog.Error 记录(库默认走标准库 log,格式不一致);
  • oekit 组件内部日志(如 distlock 续期告警)经 logx 门面输出,service 字段取可执行 文件名;logx.WithHandler 注入上面构造的 slog.Handler——格式/输出目标完全随 format(text|json) 与 level 走,与业务日志同格式落 stdout。

Types

This section is empty.

Jump to

Keyboard shortcuts

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