log

package
v0.12.37 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: BSD-3-Clause Imports: 8 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:    "",
	FileLevel:   WarnLevel,
	SentryDSN:   "",
	SentryLevel: WarnLevel,
	Release:     "",
	Environment: "",
	SkipCaller:  2,
}
View Source
var (
	DefaultLogger *ronyLogger
)

Functions

func Debug

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

func Error

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

func Fatal

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

func Info

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

func New

func New(cfg Config) *ronyLogger

func NewSentryCore

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

func SetLevel

func SetLevel(level Level)

func Warn

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

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
	FileLevel   Level
	SentryDSN   string
	SentryLevel Level
	Release     string
	Environment string
	SkipCaller  int
}

type Field

type Field = zapcore.Field

type FieldType

type FieldType = zapcore.FieldType

type Level

type Level = zapcore.Level

type Logger

type Logger interface {
	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
	Sugared() *sugaredRonyLogger
	SetLevel(level Level)
}

func Init

func Init(config Config) Logger

type SugaredLogger

type SugaredLogger interface {
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Printf(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	Fatalf(template string, args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Panic(args ...interface{})
}

Jump to

Keyboard shortcuts

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