zerologr

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

zerologr

based on zapr and glogr

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

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

Errorf logs a formatted error level log to the console

func Infof

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

Infof logs a formatted info level log to the console

func Init

func Init(level string, fixByFile, fixByFunc []string)

Init creates new instances for logr.Logger

func New

func New() logr.Logger

New returns a logr.Logger which is implemented by zerolog.

func NewWithOptions

func NewWithOptions(opts Options) logr.Logger

NewWithOptions returns a logr.Logger which is implemented by zerolog.

func Panicf

func Panicf(format string, v ...interface{})

Panicf (Panic) is not support by logr interface, leave just an error

Types

type Config added in v0.0.2

type Config struct {
	Level string `mapstructure:"level"`
}

Config seems like isn't somewhere used, so just leave it here to don't let old code fail

type Options

type Options struct {
	// Name is an optional name of the logger
	Name string
	// Logger is an instance of zerolog, if nil a default logger is used
	Logger *zerolog.Logger
}

Options that can be passed to NewWithOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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