log

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 13 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 (
	DefaultLogger *ronyLogger
	NopLogger     *ronyLogger
)

Functions

func New

func New(opts ...Option) *ronyLogger

func NewSentryCore

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

func NewSyslogCore added in v0.14.20

func NewSyslogCore(levelEnabler zapcore.LevelEnabler, encoder zapcore.Encoder, tag string) (*syslogCore, error)

func ProvideDI added in v0.12.49

func ProvideDI(opts ...Option)

ProvideDI is protected by sync.Once and provides the Logger interface for other packages.

func SetLevel

func SetLevel(level Level)

Types

type CallerEncode added in v0.12.44

type CallerEncode = zapcore.CallerEncoder

type CheckedEntry

type CheckedEntry = zapcore.CheckedEntry

type DurationEncoder added in v0.12.44

type DurationEncoder = zapcore.DurationEncoder

type Field

type Field = zapcore.Field

type FieldType

type FieldType = zapcore.FieldType

type Level

type Level = zapcore.Level

type LevelEncoder added in v0.12.44

type LevelEncoder = zapcore.LevelEncoder

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)
	With(name string) Logger
	WithWriter(w io.Writer) Logger
}

func With added in v0.12.48

func With(name string) Logger

type Option added in v0.15.2

type Option func(cfg *config)

func WithEnvironment added in v0.15.2

func WithEnvironment(env string) Option

func WithLevel added in v0.15.2

func WithLevel(lvl Level) Option

func WithMongoDB added in v0.15.2

func WithMongoDB(dsn string) Option

func WithRelease added in v0.15.2

func WithRelease(version string) Option

func WithSentry added in v0.15.2

func WithSentry(dsn string, lvl Level) Option

func WithSkipCaller added in v0.15.2

func WithSkipCaller(skip int) Option

func WithSyslog added in v0.15.2

func WithSyslog(tag string) Option

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{})
}

type TimeEncoder added in v0.12.44

type TimeEncoder = zapcore.TimeEncoder

Jump to

Keyboard shortcuts

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