Documentation ¶
Overview ¶
Package elog provides primitives for searching and processing data in Log files.
Index ¶
- func LogChecker(loader loaders.Loader, devUUID uuid.UUID, q map[string]string, ...) (err error)
- func LogItemFind(le *FullLogEntry, query map[string]string) bool
- func LogItemPrint(le *FullLogEntry, _ LogFormat, query []string) *types.PrintResult
- func LogLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error
- func LogPrn(le *FullLogEntry, format LogFormat)
- func LogWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, ...) error
- type FullLogEntry
- type HandlerFunc
- type LogCheckerMode
- type LogFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogChecker ¶
func LogChecker(loader loaders.Loader, devUUID uuid.UUID, q map[string]string, handler HandlerFunc, mode LogCheckerMode, timeout time.Duration) (err error)
LogChecker check logs by pattern from existence files with LogLast and use LogWatchWithTimeout with timeout for observe new files
func LogItemFind ¶
func LogItemFind(le *FullLogEntry, query map[string]string) bool
LogItemFind find LogItem records by reqexps in 'query' corresponded to LogItem structure.
func LogItemPrint ¶
func LogItemPrint(le *FullLogEntry, _ LogFormat, query []string) *types.PrintResult
LogItemPrint find LogItem elements by paths in 'query'
Types ¶
type FullLogEntry ¶
type FullLogEntry struct { logs.LogEntry Image string `json:"image,omitempty"` // SW image the log got emitted from EveVersion string `json:"eveVersion,omitempty"` // EVE software version }
FullLogEntry describes logs inside Adam
func ParseFullLogEntry ¶
func ParseFullLogEntry(data []byte) (fullLogEntry *FullLogEntry, err error)
ParseFullLogEntry unmarshal FullLogEntry
type HandlerFunc ¶
type HandlerFunc func(*FullLogEntry) bool
HandlerFunc must process LogItem and return true to exit or false to continue
func HandleFactory ¶
func HandleFactory(format LogFormat, once bool) HandlerFunc
HandleFactory implements HandlerFunc which prints log in the provided format
type LogCheckerMode ¶
type LogCheckerMode int
LogCheckerMode is InfoExist, InfoNew and InfoAny
const ( LogExist LogCheckerMode = -3 // just look to existing files LogNew LogCheckerMode = -2 // wait for new files LogAny LogCheckerMode = -1 // use both mechanisms )
LogChecker modes LogExist, LogNew and LogAny.
func LogTail ¶
func LogTail(count uint) LogCheckerMode
LogTail returns LogCheckerMode for process only defined count of last messages