Documentation ¶
Index ¶
- Constants
- type FakeLogClient
- func (c *FakeLogClient) Close() error
- func (c *FakeLogClient) GetAlertBuffer() bytes.Buffer
- func (c *FakeLogClient) GetAlertLogger() *log.Logger
- func (c *FakeLogClient) GetErrorBuffer() bytes.Buffer
- func (c *FakeLogClient) GetErrorLogger() *log.Logger
- func (c *FakeLogClient) GetInfoBuffer() bytes.Buffer
- func (c *FakeLogClient) GetInfoLogger() *log.Logger
- type GcpLogClient
- type GetLoggers
- type LoggingFacility
Constants ¶
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.