alogger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 11 Imported by: 0

README

basiclogger

Package basiclogger provides a basic logger implementing est.Logger, for demonstration and testing purposes.

Documentation

Overview

Package basiclogger provides a basic logger implementing est.Logger, for demonstration and testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(w io.Writer) est.Logger

New creates a new zerolog-based logger which writes to the specified writer.

Types

type GormLogger

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

GormLogger wraps the Logger to implement GORM's logger.Interface

func NewGormLogger

func NewGormLogger(estLogger est.Logger) *GormLogger

NewGormLogger creates a new GormLogger using the provided est.Logger

func (*GormLogger) Error

func (gl *GormLogger) Error(ctx context.Context, msg string, args ...interface{})

func (*GormLogger) Info

func (gl *GormLogger) Info(ctx context.Context, msg string, args ...interface{})

func (*GormLogger) LogMode

func (gl *GormLogger) LogMode(level logger.LogLevel) logger.Interface

func (*GormLogger) Trace

func (gl *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLogger) Warn

func (gl *GormLogger) Warn(ctx context.Context, msg string, args ...interface{})

type Logger

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

Logger is a zerolog-based logger implementing est.Logger.

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

Debug uses fmt.Sprint to construct and log a message.

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

Debugf uses fmt.Sprintf to log a formatted message.

func (*Logger) Debugw

func (l *Logger) Debugw(msg string, keysAndValues ...interface{})

Debugw logs a message with some additional context.

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

Error uses fmt.Sprint to construct and log a message.

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

Errorf uses fmt.Sprintf to log a formatted message.

func (*Logger) Errorw

func (l *Logger) Errorw(msg string, keysAndValues ...interface{})

Errorw logs a message with some additional context.

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

Info uses fmt.Sprint to construct and log a message.

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...interface{})

Infof uses fmt.Sprintf to log a formatted message.

func (*Logger) Infow

func (l *Logger) Infow(msg string, keysAndValues ...interface{})

Infow logs a message with some additional context.

func (*Logger) With

func (l *Logger) With(args ...interface{}) est.Logger

With adds a variadic number of key-values pairs to the logging context. The first element of the pair is used as the field key and should be a string. Passing a non-string key or passing an orphaned key panics.

Jump to

Keyboard shortcuts

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