logs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Console = "console"
	File    = "file"
)
View Source
const (
	DebugLevel int8 = iota - 1
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel
	FatalLevel
)

Variables

View Source
var Writer io.Writer

Writer global root writer

Functions

This section is empty.

Types

type FileLog

type FileLog struct {
	// non-zero value
	Path       string `json:",omitempty"`
	Maxsize    int    `json:",omitempty"`
	MaxBackups int    `json:",omitempty"`
	MaxAge     int    `json:",omitempty"`

	// zero val is valid
	Compress  bool
	LocalZone bool //backup time zone
}

FileLog config

type Log

type Log struct {
	// non-zero value
	Type string `json:",omitempty"`

	// zero val is valid
	Level int8
	File  *FileLog `yaml:",omitempty"`
}

Log config

func Defaults

func Defaults(ls []*Log) ([]*Log, error)

Defaults

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})
	Info(v ...interface{})
	Infof(format string, v ...interface{})
	Warn(v ...interface{})
	Warnf(format string, v ...interface{})
	Error(v ...interface{})
	Errorf(format string, v ...interface{})
	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})
}

Logger sugared logger interface

var SugaredLogger Logger

SugaredLogger global sugar logger provide based log print func

Jump to

Keyboard shortcuts

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