logweb

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPLogs

func HTTPLogs(w http.ResponseWriter, r *http.Request)

HTTPLogs http 请求日志

Types

type Row

type Row struct {
	Time  int64
	Msg   string
	Level int
}

Row 记录

func Page

func Page(page, limit int) ([]*Row, int)

Page 查询指定的页数据

type Rows

type Rows struct {
	Count int    `json:"count"`
	Rows  []*Row `json:"data"`
	Code  int    `json:"code"` //兼容layui
	Msg   string `json:"msg"`  //兼容layui
}

Rows 记录集

type WebWriter

type WebWriter struct {
	sync.RWMutex     // write log order by order and  atomic incr maxLinesCurLines and maxSizeCurSize
	MaxLines     int `json:"maxlines"`
	Level        int `json:"level"`
	// contains filtered or unexported fields
}

WebWriter web 日志类

func (*WebWriter) Destroy

func (lw *WebWriter) Destroy()

Destroy 空实现

func (*WebWriter) Flush

func (lw *WebWriter) Flush()

Flush 空实现

func (*WebWriter) Init

func (lw *WebWriter) Init(config string) (err error)

Init 初始化

func (*WebWriter) WriteMsg

func (lw *WebWriter) WriteMsg(when time.Time, msg string, level int) (err error)

WriteMsg 写入一个消息

Jump to

Keyboard shortcuts

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