loggers

package
v0.0.0-...-c864ae1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: BSD-2-Clause, BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTestingAnnealingObserver = buildDefaultTestingAnnealingObserver()
View Source
var DefaultTestingEventNotifier = buildTestingEventNotifier()
View Source
var DefaultTestingLogger = buildTestingLogger()
View Source
var NullTestingEventNotifier = buildNullTestingEventNotifier()

Functions

func NewNullLogger

func NewNullLogger() logging.Logger

Types

type BareBonesLogger

type BareBonesLogger struct {
	LoggerBase
}

func (*BareBonesLogger) Debug

func (bbl *BareBonesLogger) Debug(message interface{})

func (*BareBonesLogger) Error

func (bbl *BareBonesLogger) Error(message interface{})

func (*BareBonesLogger) Info

func (bbl *BareBonesLogger) Info(message interface{})

func (*BareBonesLogger) Initialise

func (bbl *BareBonesLogger) Initialise()

func (*BareBonesLogger) LogAtLevel

func (bbl *BareBonesLogger) LogAtLevel(logLevel logging.Level, message interface{})

func (*BareBonesLogger) LogAtLevelWithAttributes

func (bbl *BareBonesLogger) LogAtLevelWithAttributes(logLevel logging.Level, logAttributes attributes.Attributes)

func (*BareBonesLogger) Warn

func (bbl *BareBonesLogger) Warn(message interface{})

func (*BareBonesLogger) WithFormatter

func (bbl *BareBonesLogger) WithFormatter(formatter logging.Formatter) *BareBonesLogger

type Builder

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

Builder is a fluent constructor of a Logger, allowing the caller to specify various formatters and log-level destinations to best suit their needs.

func (*Builder) Build

func (builder *Builder) Build() (logging.Logger, error)

Build instructs Builder to finalise building its Logger, and return it to he caller.

func (*Builder) ForBareBonesLogHandler

func (builder *Builder) ForBareBonesLogHandler() *Builder

ForNativeLibraryLogHandler instructs Builder to use the native built-in go library wrapper as its Logger

func (*Builder) ForDefaultLogHandler

func (builder *Builder) ForDefaultLogHandler() *Builder

func (*Builder) ForNativeLibraryLogHandler

func (builder *Builder) ForNativeLibraryLogHandler() *Builder

ForNativeLibraryLogHandler instructs Builder to use the native built-in go library wrapper as its Logger

func (*Builder) WithFormatter

func (builder *Builder) WithFormatter(formatter logging.Formatter) *Builder

WithFormatter instructs Builder to ensure that the Logger constructed will use formatter for its log entry formatters. If not called, the default NullFormatter will be used.

func (*Builder) WithLogLevelDestination

func (builder *Builder) WithLogLevelDestination(logLevel logging.Level, destination logging.Destination) *Builder

WithLogLevelDestination instructs Builder to override the existing Destinations with a new destination for the given logLevel.

func (*Builder) WithName

func (builder *Builder) WithName(name string) *Builder

WithName instructs Builder to label the Logger being built with the specified human-friendly name.

type ContainedLogger

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

ContainedLogger is a struct offering a default container implementation of a Log Handler

func (*ContainedLogger) LogHandler

func (c *ContainedLogger) LogHandler() logging.Logger

func (*ContainedLogger) SetLogHandler

func (c *ContainedLogger) SetLogHandler(logHandler logging.Logger)

type LoggerBase

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

LoggerBase is a base struct that implements default behaviour that matches the Logger interface

func (*LoggerBase) BeingDiscarded

func (lb *LoggerBase) BeingDiscarded(logLevel logging.Level) bool

func (*LoggerBase) Destinations

func (lb *LoggerBase) Destinations() *logging.Destinations

func (*LoggerBase) Formatter

func (lb *LoggerBase) Formatter() logging.Formatter

func (*LoggerBase) Name

func (lb *LoggerBase) Name() string

func (*LoggerBase) Override

func (lb *LoggerBase) Override(logLevel logging.Level, destination logging.Destination)

func (*LoggerBase) SetDestinations

func (lb *LoggerBase) SetDestinations(destinations *logging.Destinations)

SetDestinations allows a pre-defined Destinations instance to be assigned, and subsequently used for log destination stream resolution.

func (*LoggerBase) SetFormatter

func (lb *LoggerBase) SetFormatter(formatter logging.Formatter)

SetFormatter tells the LoggerBase to use the supplied formatter for preparing a given log entry for writing to its final LogLevelDestination

func (*LoggerBase) SetName

func (lb *LoggerBase) SetName(name string)

SetName allows a human-friendly name to be assigned to the loghandler to make it easier to configure

func (*LoggerBase) SupportsLogLevel

func (lb *LoggerBase) SupportsLogLevel(logLevel logging.Level) bool

type NativeLibraryLogger

type NativeLibraryLogger struct {
	LoggerBase
	// contains filtered or unexported fields
}

func (*NativeLibraryLogger) Debug

func (nll *NativeLibraryLogger) Debug(message interface{})

func (*NativeLibraryLogger) Error

func (nll *NativeLibraryLogger) Error(message interface{})

func (*NativeLibraryLogger) Info

func (nll *NativeLibraryLogger) Info(message interface{})

func (*NativeLibraryLogger) Initialise

func (nll *NativeLibraryLogger) Initialise()

func (*NativeLibraryLogger) LogAtLevel

func (nll *NativeLibraryLogger) LogAtLevel(logLevel logging.Level, message interface{})

func (*NativeLibraryLogger) LogAtLevelWithAttributes

func (nll *NativeLibraryLogger) LogAtLevelWithAttributes(logLevel logging.Level, logAttributes attributes.Attributes)

func (*NativeLibraryLogger) Override

func (nll *NativeLibraryLogger) Override(logLevel logging.Level, destination logging.Destination)

func (*NativeLibraryLogger) Warn

func (nll *NativeLibraryLogger) Warn(message interface{})

func (*NativeLibraryLogger) WithFormatter

func (nll *NativeLibraryLogger) WithFormatter(formatter logging.Formatter) *NativeLibraryLogger

type NullLogger

type NullLogger struct{}

func (*NullLogger) BeingDiscarded

func (handler *NullLogger) BeingDiscarded(logLevel logging.Level) bool

func (*NullLogger) Debug

func (handler *NullLogger) Debug(message interface{})

func (*NullLogger) Destinations

func (handler *NullLogger) Destinations() *logging.Destinations

func (*NullLogger) Error

func (handler *NullLogger) Error(message interface{})

func (*NullLogger) Formatter

func (handler *NullLogger) Formatter() logging.Formatter

func (*NullLogger) Info

func (handler *NullLogger) Info(message interface{})

func (*NullLogger) Initialise

func (handler *NullLogger) Initialise()

func (*NullLogger) IsDefault

func (handler *NullLogger) IsDefault() bool

func (*NullLogger) LogAtLevel

func (handler *NullLogger) LogAtLevel(logLevel logging.Level, message interface{})

func (*NullLogger) LogAtLevelWithAttributes

func (handler *NullLogger) LogAtLevelWithAttributes(logLevel logging.Level, attributes attributes.Attributes)

func (*NullLogger) Name

func (handler *NullLogger) Name() string

func (*NullLogger) Override

func (handler *NullLogger) Override(logLevel logging.Level, destination logging.Destination)

func (*NullLogger) SetAsDefault

func (handler *NullLogger) SetAsDefault(isDefault bool)

func (*NullLogger) SetDestinations

func (handler *NullLogger) SetDestinations(*logging.Destinations)

func (*NullLogger) SetFormatter

func (handler *NullLogger) SetFormatter(formatter logging.Formatter)

func (*NullLogger) SetName

func (handler *NullLogger) SetName(name string)

func (*NullLogger) SupportsLogLevel

func (handler *NullLogger) SupportsLogLevel(logLevel logging.Level) bool

func (*NullLogger) Warn

func (handler *NullLogger) Warn(message interface{})

type Type

type Type int

value is here for the purposes of documentation only. It is a stand-in for any Go type, but represents the same type for any given function invocation.

Jump to

Keyboard shortcuts

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