logger

package
v0.0.0-...-683a7b2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPrefix = "logger"

ConfigPrefix define configuration prefix

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Options() *Options

	Log() zerolog.Logger
}

Logger represents the logger interface

func New

func New(opts ...Option) (Logger, error)

New creates a new logger instance

type Option

type Option func(*Options)

Option func

func Debug

func Debug(v bool) Option

Debug option

func Format

func Format(v string) Option

Format option

func InstName

func InstName(v string) Option

InstName option

func InstVersion

func InstVersion(v string) Option

InstVersion option

func Level

func Level(v string) Option

Level option

type Options

type Options struct {
	Level  string `default:"info" envconfig:"level"`
	Format string `default:"json" envconfig:"format"`

	InstName    string `default:"unknown" envconfig:"inst_name"`
	InstVersion string `default:"unknown" envconfig:"inst_version"`

	Debug bool `default:"false" envconfig:"debug"`
}

Options represents the list of options

Jump to

Keyboard shortcuts

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