logger

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDebugDomain

func AddDebugDomain(domain string, ttl time.Duration) error

AddDebugDomain adds the specified domain to the debug list.

func DebugExpiration

func DebugExpiration(domain string) *time.Time

DebugExpiration returns the expiration date for the debug mode for the instance logger of the given domain (or nil if the debug mode is not activated).

func Init

func Init(opt Options) error

Init initializes the logger module with the specified options.

func RemoveDebugDomain

func RemoveDebugDomain(domain string) error

RemoveDebugDomain removes the specified domain from the debug list.

Types

type Entry

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

Entry is the struct on which we can call the Debug, Info, Warn, Error methods with the structured data accumulated.

func WithDomain

func WithDomain(domain string) *Entry

WithDomain returns a logger with the specified domain field.

func WithNamespace

func WithNamespace(nspace string) *Entry

WithNamespace returns a logger with the specified nspace field.

func (*Entry) AddHook

func (e *Entry) AddHook(hook logrus.Hook)

Clone clones a logger entry.

func (*Entry) Debug

func (e *Entry) Debug(msg string)

func (*Entry) Debugf

func (e *Entry) Debugf(format string, args ...interface{})

func (*Entry) Error

func (e *Entry) Error(msg string)

func (*Entry) Errorf

func (e *Entry) Errorf(format string, args ...interface{})

func (*Entry) Info

func (e *Entry) Info(msg string)

func (*Entry) Infof

func (e *Entry) Infof(format string, args ...interface{})

func (*Entry) IsDebug

func (e *Entry) IsDebug() bool

IsDebug returns whether or not the debug mode is activated.

func (*Entry) Log

func (e *Entry) Log(level logrus.Level, msg string)

func (*Entry) Warn

func (e *Entry) Warn(msg string)

func (*Entry) Warnf

func (e *Entry) Warnf(format string, args ...interface{})

func (*Entry) WithField

func (e *Entry) WithField(key string, value interface{}) *Entry

WithField adds a single field to the Entry.

func (*Entry) WithFields

func (e *Entry) WithFields(fields logrus.Fields) *Entry

WithFields adds a map of fields to the Entry.

func (*Entry) WithNamespace

func (e *Entry) WithNamespace(nspace string) *Entry

WithNamespace adds a namespace (nspace field).

func (*Entry) Writer

func (e *Entry) Writer() *io.PipeWriter

type Options

type Options struct {
	Syslog bool
	Level  string
	Redis  redis.UniversalClient
}

Options contains the configuration values of the logger system

Jump to

Keyboard shortcuts

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