logger

package
v0.0.0-...-dc66ec4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ldebug = 0
	Linfo  = 1
	Lwarn  = 2
	Lerror = 3
	Lpanic = 4
	Lfatal = 6
	Lnone  = 7
)
View Source
const (
	LOG_MODE_DEBUG   = "DEBUG"
	LOG_MODE_RELEASE = "RELEASE"
)

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, fields ...zapcore.Field)

func Error

func Error(ctx context.Context, msg string, err error, fields ...zapcore.Field)

func Fatal

func Fatal(ctx context.Context, msg string, fields ...zapcore.Field)

func GetLevel

func GetLevel() int8

func Info

func Info(ctx context.Context, msg string, fields ...zapcore.Field)

func Init

func Init(op Options)

func Panic

func Panic(ctx context.Context, msg string, fields ...zapcore.Field)

func SetLevel

func SetLevel(l int8)

func Warn

func Warn(ctx context.Context, msg string, fields ...zapcore.Field)

Types

type Logger

type Logger interface {
	Debug(ctx context.Context, msg string, fields ...zapcore.Field)
	Info(ctx context.Context, msg string, fields ...zapcore.Field)
	Warn(ctx context.Context, msg string, fields ...zapcore.Field)
	Error(ctx context.Context, msg string, err error, fields ...zapcore.Field)
	Panic(ctx context.Context, msg string, fields ...zapcore.Field)
	Fatal(ctx context.Context, msg string, fields ...zapcore.Field)

	SetLevel(int8)
	GetLevel() int8
}

func New

func New(op Options) Logger

type Options

type Options struct {
	Name      string
	Mode      string
	Level     int8
	CallSkip  int
	CommonMap map[string]interface{}
	Outer     *os.File
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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