internal

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResultSuccess 表示成功执行 SQL 的结果标记。
	ResultSuccess = "success"

	// TraceId 为从 metadata 读取 trace id 的 key。
	TraceId = "trace-id"
	// UserId 为从 metadata 读取 user id 的 key。
	UserId = "user-id"
	// AppId 为从 metadata 读取调用方 app id 的 key。
	AppId = "app-id"
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(config Config, handle func(b []byte)) loger.Interface

New 构造一个 gorm logger,实现控制台输出与自定义回调输出。

Types

type Config

type Config struct {
	// Config 复用 gorm 内置 logger.Config(包含 SlowThreshold/LogLevel/Colorful 等)。
	loger.Config

	// 控制台是否输出日志
	Console bool
	// 数据库
	Database string
	// 数据库类型
	DatabaseType int32
}

Config 为自定义 gorm logger 的配置。

Jump to

Keyboard shortcuts

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