filelog

package
v0.0.0-...-2af5034 Latest Latest
Warning

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

Go to latest
Published: May 11, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLog

type FileLog struct {
	// contains filtered or unexported fields
}

FileLog is an io.Writer that appends to a /tmp file and then periodically tails these contents to a given reporter

func New

func New(jobstepID, name string) (*FileLog, error)

Create a new FileLog. Must use this rather than creating struct directly.

func NewWithOptions

func NewWithOptions(jobstepID, name string, flushDelay time.Duration, rootDir string) (*FileLog, error)

Same as New() but allows specifying how long to wait between flushing to the reporter, and the root directory for the log file (which has a sensible default if empty).

func (*FileLog) Shutdown

func (f *FileLog) Shutdown()

Shutdown the log, blocking until any remaining contents are sent to the reporter. Write() still goes to the temp file after this is called.

func (*FileLog) StartReporting

func (f *FileLog) StartReporting(reporter reporter.Reporter)

Begins reporting the contents of the log (as it is appended to) to the given reporter. Before this, Write() calls only go into the temp file. Should only be called once.

func (*FileLog) Write

func (f *FileLog) Write(p []byte) (int, error)

Writes payload to temp file, which will eventually be sent to a reporter

Jump to

Keyboard shortcuts

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