Documentation
¶
Overview ¶
Package eapps provides primitives for searching and processing data in Log files of apps.
Index ¶
- func LogChecker(loader loaders.Loader, devUUID uuid.UUID, appUUID uuid.UUID, ...) (err error)
- func LogItemFind(le LogItem, query map[string]string) bool
- func LogLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error
- func LogPrn(le *LogItem, format LogFormat)
- func LogWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, ...) error
- func ParseLogBundle(data []byte) (logBundle logs.AppInstanceLogBundle, err error)
- type HandlerFunc
- type LogCheckerMode
- type LogFormat
- type LogItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogChecker ¶
func LogChecker(loader loaders.Loader, devUUID uuid.UUID, appUUID 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 ¶
LogItemFind find LogItem records by reqexps in 'query' corresponded to LogItem structure.
func LogLast ¶
LogLast function process Log files in the 'filepath' directory according to the 'query' reqexps and return last founded item
func LogWatch ¶
func LogWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, timeoutSeconds time.Duration) error
LogWatch monitors the change of Log files in the 'filepath' directory according to the 'query' reqexps and processing using the 'handler' function.
func ParseLogBundle ¶
func ParseLogBundle(data []byte) (logBundle logs.AppInstanceLogBundle, err error)
ParseLogBundle unmarshal LogBundle
Types ¶
type HandlerFunc ¶
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
type LogItem ¶
type LogItem struct {
Source string `json:"source"`
Level string `json:"level"`
Msg string `json:"msg"`
File string `json:"file"`
Func string `json:"func"`
Time string `json:"time"`
Pid interface{} `json:"pid"`
Partition string `json:"partition"`
}
LogItem is the structure for saving log fields
func ParseLogItem ¶
ParseLogItem apply regexp on logItem