log

package
v0.0.0-...-1762b78 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Key   string
	Type  FieldType
	Value interface{}
}

func Any

func Any(key string, value interface{}) Field

func Binary

func Binary(key string, value []byte) Field

func Error

func Error(err error) Field

func Int

func Int(key string, value int) Field

func String

func String(key string, value string) Field

func Time

func Time(key string, value time.Time) Field

type FieldType

type FieldType = uint
const (
	UnknownType FieldType = iota
	BinaryType
	StringType
	IntType
	TimeType
	ErrorType
)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(mode, serviceName string, opts ...Option) (*Logger, error)

func NewTestLogger

func NewTestLogger() *Logger

NewTestLogger return instance of Logger that discards all output.

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...Field)

func (*Logger) Debugf

func (l *Logger) Debugf(template string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

func (*Logger) Errorf

func (l *Logger) Errorf(template string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

func (*Logger) Infof

func (l *Logger) Infof(template string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...Field)

func (*Logger) Warnf

func (l *Logger) Warnf(template string, args ...interface{})

type Option

type Option func(*Logger)

func WithSentry

func WithSentry(dsn string, tags map[string]string, fields ...zapcore.Field) Option

type PanicWrapper

type PanicWrapper struct {
	// contains filtered or unexported fields
}

type SentryCore

type SentryCore struct {
	// contains filtered or unexported fields
}

func (*SentryCore) Check

func (s *SentryCore) Check(entry zapcore.Entry, check *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*SentryCore) Enabled

func (s *SentryCore) Enabled(lvl zapcore.Level) bool

func (*SentryCore) Sync

func (s *SentryCore) Sync() error

func (*SentryCore) With

func (s *SentryCore) With(fields []zapcore.Field) zapcore.Core

func (*SentryCore) Write

func (s *SentryCore) Write(entry zapcore.Entry, fields []zapcore.Field) error

type SentryOptions

type SentryOptions struct {
	sentry.ClientOptions
	MinLevel     zapcore.Level
	FlushTimeout time.Duration
	Tags         map[string]string
}

SentryOptions advanced options for sentry client

type Sentryer

type Sentryer interface {
	Flush(timeout time.Duration) bool
	Recover(err interface{}, hint *sentry.EventHint, scope sentry.EventModifier) *sentry.EventID
	CaptureException(exception error, hint *sentry.EventHint, scope sentry.EventModifier) *sentry.EventID
	CaptureMessage(message string, hint *sentry.EventHint, scope sentry.EventModifier) *sentry.EventID
}

Jump to

Keyboard shortcuts

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