logger

package
v0.0.0-...-7ef7dd6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	LogConfig map[string]string

	ContainerID      string
	ContainerName    string
	ContainerImageID string
	ContainerEnvs    []string
	ContainerLabels  map[string]string
	ContainerRootDir string

	DaemonName string
}

Info provides container information for log driver.

TODO(fuwei): add more fields.

func (*Info) ExtraAttributes

func (i *Info) ExtraAttributes(keyMod func(string) string) (map[string]string, error)

ExtraAttributes returns the user-defined extra attributes (labels, environment variables) in key-value format.

NOTE: This can be used by log-driver which support metadata in log file.

func (*Info) FullID

func (i *Info) FullID() string

FullID returns the container ID.

func (*Info) ID

func (i *Info) ID() string

ID returns the container truncated ID.

func (*Info) ImageFullID

func (i *Info) ImageFullID() string

ImageFullID returns the container's image ID.

func (*Info) ImageID

func (i *Info) ImageID() string

ImageID returns the container's image truncated ID.

func (*Info) Name

func (i *Info) Name() string

Name returns the container name.

type LogMessage

type LogMessage struct {
	Source    string    // Source means stdin, stdout or stderr
	Line      []byte    // Line means the log content, but it maybe partial
	Timestamp time.Time // Timestamp means the created time of line

	Err error
}

LogMessage represents the log message in the container json log.

type LogWatcher

type LogWatcher struct {
	Msgs chan *LogMessage
	Err  chan error
	// contains filtered or unexported fields
}

LogWatcher is used to pass the log message to the reader.

func NewLogWatcher

func NewLogWatcher() *LogWatcher

NewLogWatcher returns new LogWatcher.

func (*LogWatcher) Close

func (w *LogWatcher) Close()

Close closes LogWatcher.

func (*LogWatcher) WatchClose

func (w *LogWatcher) WatchClose() <-chan struct{}

WatchClose returns the close notifier.

type ReadConfig

type ReadConfig struct {
	Since  time.Time
	Until  time.Time
	Tail   int
	Follow bool
}

ReadConfig is used to

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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