logger

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 29

Documentation

Index

Constants

View Source
const (
	JsonLogFormat = iota
	SyslogLogFormat
)

Variables

View Source
var (
	ErrControllerCode = "11071"
)

Functions

func ErrController added in v0.2.15

func ErrController(err error, msg string) error

Types

type Controller added in v0.1.31

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

func (*Controller) Enabled added in v0.1.31

func (c *Controller) Enabled() bool

func (*Controller) Error added in v0.1.31

func (c *Controller) Error(err error, msg string, keysAndValues ...interface{})

func (*Controller) Info added in v0.1.31

func (c *Controller) Info(msg string, keysAndValues ...interface{})

func (*Controller) V added in v0.1.31

func (c *Controller) V(level int) logr.InfoLogger

func (*Controller) WithName added in v0.1.31

func (c *Controller) WithName(name string) logr.Logger

func (*Controller) WithValues added in v0.1.31

func (c *Controller) WithValues(keysAndValues ...interface{}) logr.Logger

type Database added in v0.2.4

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

func (*Database) Error added in v0.2.4

func (c *Database) Error(ctx context.Context, msg string, data ...interface{})

func (*Database) Info added in v0.2.4

func (c *Database) Info(ctx context.Context, msg string, data ...interface{})

func (*Database) LogMode added in v0.2.4

func (c *Database) LogMode(level gormlogger.LogLevel) gormlogger.Interface

func (*Database) Trace added in v0.2.4

func (c *Database) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*Database) Warn added in v0.2.4

func (c *Database) Warn(ctx context.Context, msg string, data ...interface{})

type Format

type Format int

type Handler

type Handler interface {
	Info(description ...interface{})
	Debug(description ...interface{})
	Warn(err error)
	Error(err error)

	// Kubernetes Controller compliant logger
	ControllerLogger() logr.Logger
	DatabaseLogger() gormlogger.Interface
}

func New

func New(appname string, opts Options) (Handler, error)

type Logger

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

func (*Logger) ControllerLogger added in v0.1.31

func (l *Logger) ControllerLogger() logr.Logger

func (*Logger) DatabaseLogger added in v0.2.4

func (l *Logger) DatabaseLogger() gormlogger.Interface

func (*Logger) Debug

func (l *Logger) Debug(description ...interface{})

func (*Logger) Error

func (l *Logger) Error(err error)

func (*Logger) Info

func (l *Logger) Info(description ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(err error)

type Options

type Options struct {
	Format     Format
	DebugLevel bool
}

Jump to

Keyboard shortcuts

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