Documentation
¶
Overview ¶
Package logbuf 提供带序号的内存环形日志缓冲,供前端增量拉取。
Index ¶
Constants ¶
View Source
const ( LevelDebug = "debug" LevelInfo = "info" LevelWarn = "warn" LevelError = "error" )
日志级别
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer 是固定容量的环形缓冲,写满后覆盖最旧的日志。
type Entry ¶
type Entry struct {
Seq uint64 `json:"seq"`
Time time.Time `json:"time"`
Level string `json:"level"`
Source string `json:"source,omitempty"`
Message string `json:"message"`
}
Entry 是一条日志。Seq 单调递增,前端用它做增量拉取。
Click to show internal directories.
Click to hide internal directories.