logging

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFieldsContextKey = contextKey("log_fields")

	ProjectDirectoryName = "lakefs"
	ModuleName           = "github.com/treeverse/lakefs"
)
View Source
const (
	// RepositoryFieldKey repository name (string)
	RepositoryFieldKey = "repository"
	// MatchedHostFieldKey matched host (bool) true when domain extracted from host
	MatchedHostFieldKey = "matched_host"
	// RefHostFieldKey reference id (string)
	RefHostFieldKey = "ref"
	// PathFieldKey path / request URI (string)
	PathFieldKey = "path"
	// UploadIDFieldKey s3 multipart upload ID (string) "upload_id"
	UploadIDFieldKey = "upload_id"
	// ListTypeFieldKey s3 list type version (string, ex: v1 or v2)
	ListTypeFieldKey = "list_type"
	// PhysicalAddressFieldKey object physical address (string)
	PhysicalAddressFieldKey = "physical_address"
	// PartNumberFieldKey s3 multipart upload part number (string)
	PartNumberFieldKey = "part_number"
	// RequestIDFieldKey request ID (string) based on the request ID found on context
	RequestIDFieldKey = "request_id"
	// HostFieldKey request's host (string)
	HostFieldKey = "host"
	// MethodFieldKey request's method (string)
	MethodFieldKey = "method"
	// UserFieldKey user's name associated with the request (string)
	UserFieldKey = "user"
	// ServiceNameFieldKey service name (string, ex: rest_api)
	ServiceNameFieldKey = "service_name"
)

log_fields keys

Variables

This section is empty.

Functions

func AddFields

func AddFields(ctx context.Context, fields Fields) context.Context

func Level

func Level() string

func SetLevel added in v0.40.2

func SetLevel(level string)

func SetOutput added in v0.40.2

func SetOutput(output string)

func SetOutputFormat added in v0.40.2

func SetOutputFormat(format string)

Types

type AWSAdapter added in v0.40.2

type AWSAdapter struct {
	Logger Logger
}

func (*AWSAdapter) Log added in v0.40.2

func (l *AWSAdapter) Log(vars ...interface{})

type DummyLogger

type DummyLogger struct{}

func (DummyLogger) Debug

func (d DummyLogger) Debug(args ...interface{})

func (DummyLogger) Debugf

func (d DummyLogger) Debugf(format string, args ...interface{})

func (DummyLogger) Error

func (d DummyLogger) Error(args ...interface{})

func (DummyLogger) Errorf

func (d DummyLogger) Errorf(format string, args ...interface{})

func (DummyLogger) Fatal

func (d DummyLogger) Fatal(args ...interface{})

func (DummyLogger) Fatalf

func (d DummyLogger) Fatalf(format string, args ...interface{})

func (DummyLogger) Info

func (d DummyLogger) Info(args ...interface{})

func (DummyLogger) Infof

func (d DummyLogger) Infof(format string, args ...interface{})

func (DummyLogger) IsTracing

func (d DummyLogger) IsTracing() bool

func (DummyLogger) Panic

func (d DummyLogger) Panic(args ...interface{})

func (DummyLogger) Panicf

func (d DummyLogger) Panicf(format string, args ...interface{})

func (DummyLogger) Trace

func (d DummyLogger) Trace(args ...interface{})

func (DummyLogger) Tracef

func (d DummyLogger) Tracef(format string, args ...interface{})

func (DummyLogger) Warn

func (d DummyLogger) Warn(args ...interface{})

func (DummyLogger) Warnf

func (d DummyLogger) Warnf(format string, args ...interface{})

func (DummyLogger) Warning

func (d DummyLogger) Warning(args ...interface{})

func (DummyLogger) Warningf

func (d DummyLogger) Warningf(format string, args ...interface{})

func (DummyLogger) WithContext

func (d DummyLogger) WithContext(ctx context.Context) Logger

func (DummyLogger) WithError

func (d DummyLogger) WithError(err error) Logger

func (DummyLogger) WithField

func (d DummyLogger) WithField(key string, value interface{}) Logger

func (DummyLogger) WithFields

func (d DummyLogger) WithFields(fields Fields) Logger

type Fields

type Fields map[string]interface{}

type Logger

type Logger interface {
	WithContext(ctx context.Context) Logger
	WithField(key string, value interface{}) Logger
	WithFields(fields Fields) Logger
	WithError(err error) Logger
	Trace(args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Warning(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Panic(args ...interface{})
	Tracef(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	Panicf(format string, args ...interface{})
	IsTracing() bool
}

func Default

func Default() Logger

func Dummy

func Dummy() Logger

func FromContext

func FromContext(ctx context.Context) Logger

Jump to

Keyboard shortcuts

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