logger

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorLogger

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

ColorLogger implements logger.Logger interface with color support.

func (*ColorLogger) Err

func (c *ColorLogger) Err(bytes []byte)

Err implements logger.Logger.Err.

func (*ColorLogger) ErrWriter

func (c *ColorLogger) ErrWriter() io.Writer

ErrWriter returns the base writer

func (*ColorLogger) Out

func (c *ColorLogger) Out(bytes []byte)

Out implements logger.Logger.Out.

func (*ColorLogger) OutWriter

func (c *ColorLogger) OutWriter() io.Writer

OutWriter returns the base writer

type ColorLoggerFactory

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

ColorLoggerFactory implements logger.Factory interface using ColorLogger.

func NewColorLoggerFactory

func NewColorLoggerFactory() *ColorLoggerFactory

NewColorLoggerFactory creates a new ColorLoggerFactory.

func (*ColorLoggerFactory) CreateBuildLogger

func (c *ColorLoggerFactory) CreateBuildLogger(name string) Logger

CreateBuildLogger implements logger.Factory.CreateBuildLogger.

func (*ColorLoggerFactory) CreateContainerLogger

func (c *ColorLoggerFactory) CreateContainerLogger(name string) Logger

CreateContainerLogger implements logger.Factory.CreateContainerLogger.

func (*ColorLoggerFactory) CreatePullLogger

func (c *ColorLoggerFactory) CreatePullLogger(name string) Logger

CreatePullLogger implements logger.Factory.CreatePullLogger.

type Factory

type Factory interface {
	CreateContainerLogger(name string) Logger
	CreateBuildLogger(name string) Logger
	CreatePullLogger(name string) Logger
}

Factory defines methods a factory should implement, to create a Logger based on the specified container, image or service name.

type Logger

type Logger interface {
	Out(bytes []byte)
	Err(bytes []byte)
	OutWriter() io.Writer
	ErrWriter() io.Writer
}

Logger defines methods to implement for being a logger.

type NullLogger

type NullLogger struct {
}

NullLogger is a logger.Logger and logger.Factory implementation that does nothing.

func (*NullLogger) CreateBuildLogger

func (n *NullLogger) CreateBuildLogger(_ string) Logger

CreateBuildLogger allows NullLogger to implement logger.Factory.

func (*NullLogger) CreateContainerLogger

func (n *NullLogger) CreateContainerLogger(_ string) Logger

CreateContainerLogger allows NullLogger to implement logger.Factory.

func (*NullLogger) CreatePullLogger

func (n *NullLogger) CreatePullLogger(_ string) Logger

CreatePullLogger allows NullLogger to implement logger.Factory.

func (*NullLogger) Err

func (n *NullLogger) Err(_ []byte)

Err is a no-op function.

func (*NullLogger) ErrWriter

func (n *NullLogger) ErrWriter() io.Writer

ErrWriter returns the base writer

func (*NullLogger) Out

func (n *NullLogger) Out(_ []byte)

Out is a no-op function.

func (*NullLogger) OutWriter

func (n *NullLogger) OutWriter() io.Writer

OutWriter returns the base writer

type RawLogger

type RawLogger struct {
}

RawLogger is a logger.Logger and logger.Factory implementation that prints raw data with no formatting.

func (*RawLogger) CreateBuildLogger

func (r *RawLogger) CreateBuildLogger(_ string) Logger

CreateBuildLogger allows RawLogger to implement logger.Factory.

func (*RawLogger) CreateContainerLogger

func (r *RawLogger) CreateContainerLogger(_ string) Logger

CreateContainerLogger allows RawLogger to implement logger.Factory.

func (*RawLogger) CreatePullLogger

func (r *RawLogger) CreatePullLogger(_ string) Logger

CreatePullLogger allows RawLogger to implement logger.Factory.

func (*RawLogger) Err

func (r *RawLogger) Err(message []byte)

Err is a no-op function.

func (*RawLogger) ErrWriter

func (r *RawLogger) ErrWriter() io.Writer

ErrWriter returns the base writer

func (*RawLogger) Out

func (r *RawLogger) Out(message []byte)

Out is a no-op function.

func (*RawLogger) OutWriter

func (r *RawLogger) OutWriter() io.Writer

OutWriter returns the base writer

type Wrapper

type Wrapper struct {
	Err    bool
	Logger Logger
}

Wrapper is a wrapper around Logger that implements the Writer interface, mainly use by docker/pkg/stdcopy functions.

func (*Wrapper) Write

func (l *Wrapper) Write(bytes []byte) (int, error)

Jump to

Keyboard shortcuts

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