eapps

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package eapps provides primitives for searching and processing data in Log files of apps.

Index

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

func LogItemFind(le *logs.LogEntry, query map[string]string) bool

LogItemFind find LogItem records by reqexps in 'query' corresponded to LogItem structure.

func LogItemPrint

func LogItemPrint(le *logs.LogEntry, _ LogFormat, query []string) *types.PrintResult

LogItemPrint find LogItem elements by paths in 'query'

func LogLast

func LogLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error

LogLast function process Log files in the 'filepath' directory according to the 'query' reqexps and return last founded item

func LogPrn

func LogPrn(le *logs.LogEntry, format LogFormat)

LogPrn print Log data

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 ParseLogEntry

func ParseLogEntry(data []byte) (logEntry *logs.LogEntry, err error)

ParseLogEntry unmarshal LogEntry

Types

type HandlerFunc

type HandlerFunc func(*logs.LogEntry) 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

type LogFormat

type LogFormat byte

LogFormat the format to print output logs

const (
	//LogLines returns log line by line
	LogLines LogFormat = iota
	//LogJSON returns log in JSON format
	LogJSON
)

Jump to

Keyboard shortcuts

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