zlog

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustZapSugar

func MustZapSugar(options ...Option) *zap.SugaredLogger

func NewZapSugar

func NewZapSugar(options ...Option) (*zap.SugaredLogger, error)

Types

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(f string, v ...interface{})
	Debugw(msg string, kv ...interface{})

	Info(v ...interface{})
	Infof(f string, v ...interface{})
	Infow(msg string, kv ...interface{})

	Warn(v ...interface{})
	Warnf(f string, v ...interface{})
	Warnw(msg string, kv ...interface{})

	Error(v ...interface{})
	Errorf(f string, v ...interface{})
	Errorw(msg string, kv ...interface{})

	Panic(v ...interface{})
	Panicf(f string, v ...interface{})
	Panicw(msg string, kv ...interface{})

	Fatal(v ...interface{})
	Fatalf(f string, v ...interface{})
	Fatalw(msg string, kv ...interface{})
}
var Default Logger = MustZapSugar()

func New

func New(options ...Option) Logger

type Option

type Option func(*ZapSugerConfig)

func WithCompress

func WithCompress(compress bool) Option

WithCompress sets the Compress

func WithDebug

func WithDebug(debug bool) Option

WithDebug sets the Debug

func WithFilename

func WithFilename(filename func() string) Option

WithFilename sets the Filename

func WithLocalTime

func WithLocalTime(localtime bool) Option

WithLocalTime sets the LocalTime

func WithMaxAge

func WithMaxAge(maxage int) Option

WithMaxAge sets the MaxAge

func WithMaxBackups

func WithMaxBackups(maxbackups int) Option

WithMaxBackups sets the MaxBackups

func WithMaxSize

func WithMaxSize(maxsize int) Option

WithMaxSize sets the MaxSize

type Thing

type Thing struct {
	Filename string
	MaxSize  int
	Field3   map[byte]float64
}

type ZapSugerConfig

type ZapSugerConfig struct {
	Filename   func() string `opt`
	MaxSize    int           `opt`
	MaxAge     int           `opt`
	MaxBackups int           `opt`
	LocalTime  bool          `opt`
	Compress   bool          `opt`
	Debug      bool          `opt`
}

Jump to

Keyboard shortcuts

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