logrusx

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigSchemaID = "clinia://logging-config"

Variables

View Source
var ConfigSchema string

Functions

func AddConfigSchema

func AddConfigSchema(c interface {
	AddResource(url string, r io.Reader) error
}) error

AddConfigSchema adds the logging schema to the compiler. The interface is specified instead of `jsonschema.Compiler` to allow the use of any jsonschema library fork or version.

Types

type Logger

type Logger struct {
	*logrus.Entry
	// contains filtered or unexported fields
}

func New

func New(name string, version string, opts ...Option) *Logger

New creates a new logger with all the important fields set.

func NewAudit

func NewAudit(name string, version string, opts ...Option) *Logger

func (*Logger) Debugf

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

func (*Logger) Errorf

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

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

func (*Logger) HTTPHeadersRedacted

func (l *Logger) HTTPHeadersRedacted(h http.Header) map[string]interface{}

func (*Logger) Infof

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

func (*Logger) LeakSensitiveData

func (l *Logger) LeakSensitiveData() bool

func (*Logger) Logf

func (l *Logger) Logf(level logrus.Level, format string, args ...interface{})

func (*Logger) Logrus

func (l *Logger) Logrus() *logrus.Logger

func (*Logger) NewEntry

func (l *Logger) NewEntry() *Logger

func (*Logger) Panicf

func (l *Logger) Panicf(format string, args ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

func (*Logger) Tracef

func (l *Logger) Tracef(format string, args ...interface{})

func (*Logger) UseConfig

func (l *Logger) UseConfig(c configurator)

func (*Logger) Warnf

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

func (*Logger) Warningf

func (l *Logger) Warningf(format string, args ...interface{})

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *Logger

func (*Logger) WithError

func (l *Logger) WithError(err error) *Logger

func (*Logger) WithField

func (l *Logger) WithField(key string, value interface{}) *Logger

func (*Logger) WithFields

func (l *Logger) WithFields(f logrus.Fields) *Logger

func (*Logger) WithRequest

func (l *Logger) WithRequest(r *http.Request) *Logger

func (*Logger) WithSensitiveField

func (l *Logger) WithSensitiveField(key string, value interface{}) *Logger

func (*Logger) WithSensitiveHeaders added in v0.0.53

func (l *Logger) WithSensitiveHeaders(headers ...string) *Logger

type Option

type Option func(*options)

func ForceFormat

func ForceFormat(format string) Option

func ForceFormatter

func ForceFormatter(formatter logrus.Formatter) Option

func ForceLevel

func ForceLevel(level logrus.Level) Option

func LeakSensitive

func LeakSensitive() Option

func RedactionText

func RedactionText(text string) Option

func ReportCaller

func ReportCaller(reportCaller bool) Option

func UseLogger

func UseLogger(l *logrus.Logger) Option

func WithConfigurator

func WithConfigurator(c configurator) Option

func WithExitFunc

func WithExitFunc(exitFunc func(int)) Option

func WithHook

func WithHook(hook logrus.Hook) Option

func WithSensitiveHeaders added in v0.0.53

func WithSensitiveHeaders(headers ...string) Option

Jump to

Keyboard shortcuts

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