log

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = zapcore.DebugLevel
	InfoLevel  = zapcore.InfoLevel
	WarnLevel  = zapcore.WarnLevel
	ErrorLevel = zapcore.ErrorLevel
	FatalLevel = zapcore.FatalLevel
)

Variables

View Source
var DefaultConfig = Config{
	Level:       InfoLevel,
	DirPath:     ".",
	Filename:    "",
	SentryDSN:   "",
	SentryLevel: WarnLevel,
	Release:     "",
	Environment: "",
}
View Source
var (
	DefaultLogger *zapLogger
)

Functions

func Debug

func Debug(msg string, fields ...Field)

func Error

func Error(msg string, fields ...Field)

func ErrorOnError

func ErrorOnError(guideText string, err error, args ...interface{})

PanicOnError

func Fatal

func Fatal(msg string, fields ...Field)

func Info

func Info(msg string, fields ...Field)

func NewSentryCore

func NewSentryCore(sentryDSN, release, environment string, level zapcore.Level, tags map[string]string) zapcore.Core

func PanicOnError

func PanicOnError(guideText string, err error, args ...interface{})

PanicOnError

func SetLevel

func SetLevel(level Level)

func Warn

func Warn(msg string, fields ...Field)

func WarnOnError

func WarnOnError(guideText string, err error, args ...interface{})

WarnOnError

Types

type CheckedEntry

type CheckedEntry = zapcore.CheckedEntry

func Check

func Check(level Level, msg string) *CheckedEntry

type Config

type Config struct {
	Level       Level
	DirPath     string
	Filename    string
	SentryDSN   string
	SentryLevel Level
	Release     string
	Environment string
}

type Field

type Field = zapcore.Field

type Level

type Level = zapcore.Level

type Logger

type Logger interface {
	Log(level Level, msg string, fields ...Field)
	Debug(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Error(msg string, fields ...Field)
	Fatal(msg string, fields ...Field)
	Check(Level, string) *CheckedEntry
	Sync() error
	SetLevel(level Level)
}

func Init

func Init(config Config) Logger

Jump to

Keyboard shortcuts

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