logger

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: Apache-2.0 Imports: 8 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 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