logger

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *log.Logger
)

Functions

func Debug

func Debug(msg string, args ...interface{})

Debug 记录调试日志

func Error

func Error(msg string, args ...interface{})

Error 记录错误日志

func ErrorLocal added in v0.7.0

func ErrorLocal(msg string, args ...interface{})

ErrorLocal 仅写入 deploy 本机日志,不向服务端上报可能包含私密诊断的信息。

func Fatal

func Fatal(msg string, args ...interface{})

Fatal 记录致命错误日志并退出

func Info

func Info(msg string, args ...interface{})

Info 记录信息日志

func InfoLocal added in v0.7.0

func InfoLocal(msg string, args ...interface{})

InfoLocal 仅写入 deploy 本机信息日志,不向服务端上报私密运行参数。

func Init

func Init()

Init 初始化日志

func SetReporter added in v0.5.0

func SetReporter(r *LogReporter)

SetReporter 设置日志上报器

func SetSensitiveValues added in v0.7.0

func SetSensitiveValues(values ...string)

SetSensitiveValues 设置在线日志必须额外清除的实际配置值,防止第三方 SDK 无字段名回显凭据。

func Warn

func Warn(msg string, args ...interface{})

Warn 记录警告日志

func WarnLocal added in v0.7.0

func WarnLocal(msg string, args ...interface{})

WarnLocal 仅写入 deploy 本机警告日志,不向服务端上报私密诊断。

Types

type LogLevel added in v0.5.0

type LogLevel string

LogLevel 日志级别

const (
	LevelDebug LogLevel = "DEBUG"
	LevelInfo  LogLevel = "INFO"
	LevelWarn  LogLevel = "WARN"
	LevelError LogLevel = "ERROR"
	LevelFatal LogLevel = "FATAL"
)

type LogReporter added in v0.5.0

type LogReporter struct {
	ServerURL string // ServerURL 是日志服务基础地址。
	ClientID  string // ClientID 标识当前部署客户端。
	AccessKey string // AccessKey 用于日志接口认证。
	// contains filtered or unexported fields
}

LogReporter 日志上报器(用于上报到服务端)

Jump to

Keyboard shortcuts

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