basiclogger

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 8 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 basic logger which writes to the specified writer.

Types

type Logger

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

Logger is a basic 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. The variadic key-value pairs are treated as they are in With.

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. The variadic key-value pairs are treated as they are in With.

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. The variadic key-value pairs are treated as they are in With.

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