internal

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsoleCore

func NewConsoleCore(level zapcore.LevelEnabler) zapcore.Core

NewConsoleCore 构造一个输出到 stdout 的 console encoder core。

设计要点: - 采用 ProductionEncoderConfig,字段与 zap 默认生产格式保持一致 - 通过自定义 EncodeTime/EncodeLevel/EncodeCaller,把输出变成更利于人读的形式 - 返回的 Core 可与 JSON Core 通过 zapcore.NewTee 合并

func NewRemoteCore added in v0.2.0

func NewRemoteCore(level zapcore.LevelEnabler, handle func(b []byte)) zapcore.Core

NewRemoteCore 构造一个远端输出 core。

该 core 的目标是减少额外编解码:直接在 core.Write 中组装目标 JSON,并调用 handle。

Types

type ServerLogger added in v0.2.4

type ServerLogger struct {
	Path    string `json:"path"`
	Level   uint32 `json:"level"`
	Content string `json:"content"`

	TraceId  string `json:"trace_id"`
	ParentId string `json:"parent_id"`

	UserId string `json:"user_id"`
}

ServerLogger 表示服务端日志。

Jump to

Keyboard shortcuts

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