glogger

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GLogger *logrus.Entry
View Source
var Logrus *logrus.Logger = logrus.New()

Functions

func Close

func Close() error

* * 关闭日志记录器 *

func NewWSLogHook

func NewWSLogHook(ss string) wsLogHook

func StartGLogger

func StartGLogger(LogLevel string,
	EnableConsole bool,
	AppDebugMode bool,
	path string,
	key string, value interface{})

func WsLogger

func WsLogger(c *gin.Context)

Types

type LogMsg

type LogMsg struct {
	Sn      string `json:"sn"`
	Uid     string `json:"uid"`
	Content string `json:"content"`
}

type LogWriter

type LogWriter struct {
	// contains filtered or unexported fields
}

* * 日志记录器,未来会移除这个slot *

func NewLogWriter

func NewLogWriter(filepath string) *LogWriter

func (*LogWriter) Close

func (lw *LogWriter) Close() error

func (*LogWriter) Write

func (lw *LogWriter) Write(b []byte) (n int, err error)

* * 日志记录的本地的同时,可能会记录到远程UDP Server, 该功能主要用来远程诊断 *

type RealTimeLogger

type RealTimeLogger struct {
	WsServer websocket.Upgrader
	Clients  map[string]*websocket.Conn
	// contains filtered or unexported fields
}

* * 这是用来给外部输出日志的websocket服务器,其功能非常简单,就是单纯的对外输出实时日志,方便调试使用。 * 注意:该功能需要配合HttpApiServer使用, 客户端连上以后必须在5s内发送一个 ‘WsTerminal’ 的固定字符 * 串到服务器才能过认证。 *

func StartNewRealTimeLogger

func StartNewRealTimeLogger(s string) *RealTimeLogger

func (*RealTimeLogger) Write

func (w *RealTimeLogger) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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