logger

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

type DefaultLogger struct {
	*log.Logger
	Weight logger.Weight
}

DefaultLogger has Go's built-in logger embedded in it. It adds level logging. To set the logging level, one should use the LoggingLevel property. For example to set it to debug level:

config.SetProperty(property.LoggingLevel.Name(), logger.DebugLevel)

If loggerConfig.SetLogger() method is called, the LoggingLevel property will not be used.

func New

func New() *DefaultLogger

New returns a Default Logger with defaultLogLevel.

func NewWithLevel

func NewWithLevel(loggingLevel logger.Level) (*DefaultLogger, error)

func (*DefaultLogger) Log added in v1.2.0

func (l *DefaultLogger) Log(wantedLevel logger.Weight, formatter func() string)

type LogAdaptor added in v1.2.0

type LogAdaptor struct {
	logger.Logger
}

LogAdaptor is used to convert logger implementations of public interface logger.LogAdaptor to internal logging interface LogAdaptor

func (LogAdaptor) Debug added in v1.2.0

func (la LogAdaptor) Debug(f func() string)

Debug runs the given function to generate the logger string, if logger level is debug or finer.

func (LogAdaptor) Errorf added in v1.2.0

func (la LogAdaptor) Errorf(format string, values ...interface{})

Errorf formats the given string with the given values, if logger level is error or finer.

func (LogAdaptor) Info added in v1.2.0

func (la LogAdaptor) Info(f func() string)

Info runs the given function to generate the logger string, if logger level is trace or finer.

func (LogAdaptor) Infof added in v1.2.0

func (la LogAdaptor) Infof(format string, values ...interface{})

Infof formats the given string with the given values, if logger level is info or finer.

func (LogAdaptor) Trace added in v1.2.0

func (la LogAdaptor) Trace(f func() string)

Trace runs the given function to generate the logger string, if logger level is trace or finer.

func (LogAdaptor) TraceHere added in v1.3.0

func (la LogAdaptor) TraceHere()

TraceHere logs the function name, source file and line number of the call site.

func (LogAdaptor) Warnf added in v1.2.0

func (la LogAdaptor) Warnf(format string, values ...interface{})

Warnf formats the given string with the given values, if logger level is warn or finer.

Jump to

Keyboard shortcuts

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