logging

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware() gin.HandlerFunc

Middleware which provides ability to log with gin using the built in zerolog logger instead of the default one

func SetupLogger

func SetupLogger(c *Config, fp string)

Types

type Config

type Config struct {
	Level        Level `yaml:"level"`
	LogToFile    bool  `yaml:"log_to_file"`
	LogToConsole bool  `yaml:"log_to_console"`
}

func DefaultConfig

func DefaultConfig() *Config

type Level

type Level zerolog.Level

Level wraps zerolog.Level in order to marshal into the config.yml file as a string

const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel

	TraceLevel Level = -1
)

func (Level) MarshalYAML

func (l Level) MarshalYAML() (interface{}, error)

func (Level) String

func (l Level) String() string

func (Level) UnmarshalYAML

func (l Level) UnmarshalYAML(unmarshal func(interface{}) error) error

func (Level) Zerolog

func (l Level) Zerolog() zerolog.Level

Jump to

Keyboard shortcuts

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