logger

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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 Fatal

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

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

func Info

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

Info 记录信息日志

func Init

func Init()

Init 初始化日志

func SetReporter added in v0.5.0

func SetReporter(r *LogReporter)

SetReporter 设置日志上报器

func Warn

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

Warn 记录警告日志

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
	ClientID  string
	AccessKey string
}

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

Jump to

Keyboard shortcuts

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