logs

package
v2.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogTimeFormat is the time format used in the log.
	// It is a modified version of RFC3339Nano that guarantees trailing
	// zeroes are not trimmed, taken from
	// https://github.com/golang/go/issues/19635
	LogTimeFormat = "2006-01-02T15:04:05.000000000Z07:00"

	// PartialLogType signifies a log line that exceeded the buffer
	// length and needed to spill into a new line
	PartialLogType = "P"

	// FullLogType signifies a log line is full
	FullLogType = "F"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLine

type LogLine struct {
	Device       string
	ParseLogType string
	Time         time.Time
	Msg          string
	CID          string
	CName        string
}

LogLine describes the information for each line of a log

func GetLogFile

func GetLogFile(path string, options *LogOptions) (*tail.Tail, []*LogLine, error)

GetLogFile returns an hp tail for a container given options

func NewLogLine

func NewLogLine(line string) (*LogLine, error)

NewLogLine creates a logLine struct from a container log string

func (*LogLine) Partial

func (l *LogLine) Partial() bool

Partial returns a bool if the log line is a partial log type

func (*LogLine) Since

func (l *LogLine) Since(since time.Time) bool

Since returns a bool as to whether a log line occurred after a given time

func (*LogLine) String

func (l *LogLine) String(options *LogOptions) string

String converts a logline to a string for output given whether a detail bool is specified.

type LogOptions

type LogOptions struct {
	Details    bool
	Follow     bool
	Since      time.Time
	Tail       int64
	Timestamps bool
	Multi      bool
	WaitGroup  *sync.WaitGroup
	UseName    bool
}

LogOptions is the options you can use for logs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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