gologging

package
v0.0.0-...-5348dab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const LogBufferLength = 4096

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLogS3Writer

type FileLogS3Writer struct {
	Interrupt chan bool
	// contains filtered or unexported fields
}

This log writer sends output to a file

func StartS3LogWriter

func StartS3LogWriter(uploader *uploader.UploaderPool, info *gen.InstanceInfo, coordinator *RotateCoordinator) (*FileLogS3Writer, error)

func (*FileLogS3Writer) Close

func (w *FileLogS3Writer) Close()

func (*FileLogS3Writer) LogWrite

func (w *FileLogS3Writer) LogWrite(rec *LogRecord)

This is the FileLogS3Writer's output method

type LogRecord

type LogRecord struct {
	Message string
}

type Logger

type Logger interface {
	LogWrite(*LogRecord)
	Close()
}

type RotateCoordinator

type RotateCoordinator struct {
	MaxLines int
	MaxTime  time.Duration
	// contains filtered or unexported fields
}

func NewRotateCoordinator

func NewRotateCoordinator(maxLines int, maxTime time.Duration) *RotateCoordinator

func (*RotateCoordinator) TestForRotate

func (r *RotateCoordinator) TestForRotate() bool

Updates the RotateCoordinator and returns true if rotate conditions are met.

func (*RotateCoordinator) Update

func (r *RotateCoordinator) Update()

type UploadLogger

type UploadLogger struct {
	Uploader *uploader.UploaderPool
	Logger   Logger
}

func StartS3Logger

func StartS3Logger(
	coordinator *RotateCoordinator,
	info *gen.InstanceInfo,
	notifier uploader.NotifierHarness,
	builder uploader.Factory,
	errorLogger uploader.ErrorNotifierHarness,
	numWorkers int,
) (*UploadLogger, error)

func (*UploadLogger) Close

func (u *UploadLogger) Close()

func (*UploadLogger) Log

func (u *UploadLogger) Log(arg string)

func (*UploadLogger) Logf

func (u *UploadLogger) Logf(arg0 string, args ...interface{})

Jump to

Keyboard shortcuts

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