logger

package
v2.20.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger provides a log interface to verbose messages to the user

func NewDummyLogger

func NewDummyLogger(name string) *Logger

NewDummyLogger create a dummy no-op logger

func NewLogger

func NewLogger(name string, options Options) *Logger

NewLogger create a logger with given options

func (Logger) Debug

func (l Logger) Debug(args ...interface{})

Debug logs a debug message

func (Logger) Debugf

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

Debugf logs a debug message with a format string

func (Logger) Error

func (l Logger) Error(args ...interface{})

Error logs an error message

func (Logger) Errorf

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

Errorf logs an error message with a format string

func (Logger) Fatal

func (l Logger) Fatal(args ...interface{})

Fatal logs a information message

func (Logger) Fatalf

func (l Logger) Fatalf(format string, args ...interface{})

Fatalf logs a information message with a format string

func (Logger) Info

func (l Logger) Info(args ...interface{})

Info logs a information message

func (Logger) Infof

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

Infof logs a information message with a format string

func (Logger) Printf

func (l Logger) Printf(format string, args ...interface{})

Printf is an alias for Infof

func (Logger) Println

func (l Logger) Println(args ...interface{})

Println is an alias for Info

func (Logger) Warn

func (l Logger) Warn(args ...interface{})

Warn logs a warning message

func (Logger) Warnf

func (l Logger) Warnf(format string, args ...interface{})

Warnf logs a warning message with a format string

func (Logger) Warning

func (l Logger) Warning(args ...interface{})

Warning logs a warning message

func (Logger) Warningf

func (l Logger) Warningf(format string, args ...interface{})

Warningf logs a warning message with a format string

type LoggerInterface

type LoggerInterface interface {
	Debugt(msg string, fields ...zapcore.Field)
	Debugf(template string, args ...interface{})
	Debugw(msg string, keysAndValues ...interface{})
	Debug(msg string, keysAndValues ...interface{})
	Debugs(args ...interface{})

	Infot(msg string, fields ...zapcore.Field)
	Infof(template string, args ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Info(msg string, keysAndValues ...interface{})
	Infos(args ...interface{})

	Warnt(msg string, fields ...zapcore.Field)
	Warnf(template string, args ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Warn(msg string, keysAndValues ...interface{})
	Warns(args ...interface{})

	Errort(msg string, fields ...zapcore.Field)
	Errorf(template string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Error(msg string, keysAndValues ...interface{})
	Errors(args ...interface{})

	Panict(msg string, fields ...zapcore.Field)
	Panicf(template string, args ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Panic(msg string, keysAndValues ...interface{})
	Panics(args ...interface{})

	Fatalt(msg string, fields ...zapcore.Field)
	Fatalf(template string, args ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})
	Fatal(msg string, keysAndValues ...interface{})
	Fatals(args ...interface{})

	AtLevel(level zapcore.Level, msg string, fields ...zapcore.Field) *Logger
}

type Options

type Options struct {
	// Silent removes silences all log messages
	Silent bool

	// Color prints the log levels in color
	Color bool

	// Debug activates all log messages
	Debug bool

	// Level default log level
	Level zapcore.Level
}

Options holds settings of the logger

Jump to

Keyboard shortcuts

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