logclient

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexLogInfo = iota
	IndexLogError
	IndexLogAlert
)

These constants refer to the logging levels.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeLogClient

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

FakeLogClient is a fake log client.

func NewFakeLogClient

func NewFakeLogClient() *FakeLogClient

NewFakeLogClient returns a new FakeLogClient.

func (*FakeLogClient) Close

func (c *FakeLogClient) Close() error

Close is a NOP (there is nothing to close).

func (*FakeLogClient) GetAlertBuffer

func (c *FakeLogClient) GetAlertBuffer() bytes.Buffer

GetAlertBuffer exposes the internal Alert logger's buffer.

func (*FakeLogClient) GetAlertLogger

func (c *FakeLogClient) GetAlertLogger() *log.Logger

GetAlertLogger exposes the internal Alert logger.

func (*FakeLogClient) GetErrorBuffer

func (c *FakeLogClient) GetErrorBuffer() bytes.Buffer

GetErrorBuffer exposes the internal Error logger's buffer.

func (*FakeLogClient) GetErrorLogger

func (c *FakeLogClient) GetErrorLogger() *log.Logger

GetErrorLogger exposes the internal Error logger.

func (*FakeLogClient) GetInfoBuffer

func (c *FakeLogClient) GetInfoBuffer() bytes.Buffer

GetInfoBuffer exposes the internal Info logger's buffer.

func (*FakeLogClient) GetInfoLogger

func (c *FakeLogClient) GetInfoLogger() *log.Logger

GetInfoLogger exposes the internal Info logger.

type GcpLogClient

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

GcpLogClient is a GCP log client.

func NewGcpLogClient

func NewGcpLogClient(
	projectID, logName string,
) (*GcpLogClient, error)

NewGcpLogClient returns a new LoggingFacility that logs to GCP resources. As such, it requires the GCP projectID as well as the logName to log to.

func (*GcpLogClient) Close

func (c *GcpLogClient) Close() error

Close simply calls Close() to the underlying logging client (from which the child loggers are derived).

func (*GcpLogClient) GetAlertLogger

func (c *GcpLogClient) GetAlertLogger() *log.Logger

GetAlertLogger exposes the internal Alert logger.

func (*GcpLogClient) GetErrorLogger

func (c *GcpLogClient) GetErrorLogger() *log.Logger

GetErrorLogger exposes the internal Error logger.

func (*GcpLogClient) GetInfoLogger

func (c *GcpLogClient) GetInfoLogger() *log.Logger

GetInfoLogger exposes the internal Info logger.

type GetLoggers

type GetLoggers interface {
	GetInfoLogger() *log.Logger
	GetErrorLogger() *log.Logger
	GetAlertLogger() *log.Logger
}

GetLoggers extracts 3 loggers, corresponding to the logging levels defined above.

type LoggingFacility

type LoggingFacility interface {
	GetLoggers
	io.Closer
}

LoggingFacility bundles 3 loggers together.

Jump to

Keyboard shortcuts

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