log

package
v0.0.0-...-c406baf Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 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 Level

type Level string
const (
	Debug Level = "debug"
	Info  Level = "info"
	Warn  Level = "warn"
	Err   Level = "error"
)

type Logger

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

func New

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

New is deprecated, use NewLogger deprecated

func NewLogger

func NewLogger(service string, logLevel Level) (*Logger, error)

func NewTestLogger

func NewTestLogger() *Logger

NewTestLogger return instance of Logger that discards all output.

func (*Logger) AddField

func (l *Logger) AddField(name, value string) *Logger

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
}

type TemporalLogger

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

TemporalLogger wraps the Logger struct and implements the Temporal Logger interface:

    Logger interface {
		Debug(msg string, keyvals ...interface{})
		Info(msg string, keyvals ...interface{})
		Warn(msg string, keyvals ...interface{})
		Error(msg string, keyvals ...interface{})
	  }

func NewTemporalLogger

func NewTemporalLogger(logger *Logger) *TemporalLogger

func (*TemporalLogger) Debug

func (t *TemporalLogger) Debug(msg string, keyvals ...interface{})

func (*TemporalLogger) Error

func (t *TemporalLogger) Error(msg string, keyvals ...interface{})

func (*TemporalLogger) Info

func (t *TemporalLogger) Info(msg string, keyvals ...interface{})

func (*TemporalLogger) Warn

func (t *TemporalLogger) Warn(msg string, keyvals ...interface{})

Jump to

Keyboard shortcuts

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