loggerdebug

package
v2.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadLastLines

func ReadLastLines(filePath string, n int) ([]string, error)

ReadLastLines 读取文件最后 n 行

Types

type FileInfo

type FileInfo struct {
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	ModTime string `json:"modTime"`
}

FileInfo 日志文件信息

type LogEntry

type LogEntry struct {
	Time    string         `json:"time"`
	Level   string         `json:"level"`
	Caller  string         `json:"caller"`
	Message string         `json:"message"`
	Logger  string         `json:"logger"`
	Fields  map[string]any `json:"-"`
	Raw     string         `json:"raw"`
}

LogEntry 日志条目

type LogStats

type LogStats struct {
	Total    int      `json:"total"`
	Trace    int      `json:"trace"`
	Debug    int      `json:"debug"`
	Info     int      `json:"info"`
	Warnings int      `json:"warnings"`
	Errors   int      `json:"errors"`
	Loggers  []string `json:"loggers"`
}

LogStats 日志统计

type QueryRequest

type QueryRequest struct {
	Filter   string `json:"filter"`
	Level    string `json:"level"`
	Logger   string `json:"logger"`
	Keyword  string `json:"keyword"`
	Start    string `json:"start"`
	End      string `json:"end"`
	Limit    int    `json:"limit"`
	Offset   int    `json:"offset"`
	Tail     bool   `json:"tail"`
	FileName string `json:"fileName"`
}

QueryRequest 查询请求

type QueryResponse

type QueryResponse struct {
	Logs        []LogEntry `json:"logs"`
	Total       int        `json:"total"`
	HasMore     bool       `json:"hasMore"`
	Files       []FileInfo `json:"files"`
	CurrentFile string     `json:"currentFile"`
}

QueryResponse 查询响应

Jump to

Keyboard shortcuts

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