logger

package
v0.9.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	shared.Reference
	Name string
	// contains filtered or unexported fields
}

func Default

func Default() *Adapter

func NewLogger

func NewLogger(name string, logger Logger) *Adapter

func (*Adapter) ColumnsDetection

func (l *Adapter) ColumnsDetection(sql, source string)

func (*Adapter) Inherit

func (l *Adapter) Inherit(adapter *Adapter)

func (*Adapter) Log added in v0.8.0

func (l *Adapter) Log(message string, args ...interface{})

func (*Adapter) LogDatabaseErr added in v0.2.7

func (l *Adapter) LogDatabaseErr(SQL string, err error, args ...interface{})

func (*Adapter) ObjectReconciling

func (l *Adapter) ObjectReconciling(dst, item, parent interface{}, index int)

func (*Adapter) ReadTime

func (l *Adapter) ReadTime(viewName string, start, end *time.Time, err error)

func (*Adapter) ReadingData

func (l *Adapter) ReadingData(duration time.Duration, SQL string, read int, params []interface{}, err error)

type AdapterIndex

type AdapterIndex map[string]*Adapter

func (AdapterIndex) Lookup

func (i AdapterIndex) Lookup(name string) (*Adapter, bool)

func (AdapterIndex) Register

func (i AdapterIndex) Register(adapter *Adapter)

type Adapters

type Adapters []*Adapter

func (Adapters) Index

func (a Adapters) Index() AdapterIndex

type ColumnsDetection

type ColumnsDetection func(sql, source string)

type Counter

type Counter interface {
	Begin(started time.Time) counter.OnDone
	DecrementValue(value interface{}) int64
	IncrementValue(value interface{}) int64
}

type CounterAdapter

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

func NewCounter

func NewCounter(counter Counter) *CounterAdapter

func (*CounterAdapter) Begin

func (c *CounterAdapter) Begin(started time.Time) counter.OnDone

func (*CounterAdapter) Counter added in v0.8.0

func (c *CounterAdapter) Counter() Counter

func (*CounterAdapter) DecrementValue

func (c *CounterAdapter) DecrementValue(value interface{}) int64

func (*CounterAdapter) IncrementValue

func (c *CounterAdapter) IncrementValue(value interface{}) int64

type Log added in v0.2.7

type Log func(message string, args ...interface{})

type Logger

type Logger interface {
	ColumnsDetection() ColumnsDetection
	ObjectReconciling() ObjectReconciling
	ReadingData() ReadingData
	ViewReadTime() ReadTime
	OverallReadTime() ReadTime
	Log() Log
}

type ObjectReconciling

type ObjectReconciling func(dst, item, parent interface{}, index int)

type ReadTime

type ReadTime func(viewName string, start *time.Time, end *time.Time, err error)

type ReadingData

type ReadingData func(duration time.Duration, sql string, read int, params []interface{}, err error)

type TimeLogger

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

func NewTimeLogger

func NewTimeLogger(view, global time.Duration) *TimeLogger

func (*TimeLogger) ColumnsDetection

func (t *TimeLogger) ColumnsDetection() ColumnsDetection

func (*TimeLogger) Log added in v0.2.7

func (t *TimeLogger) Log() Log

func (*TimeLogger) ObjectReconciling

func (t *TimeLogger) ObjectReconciling() ObjectReconciling

func (*TimeLogger) OverallReadTime

func (t *TimeLogger) OverallReadTime() ReadTime

func (*TimeLogger) ReadingData

func (t *TimeLogger) ReadingData() ReadingData

func (*TimeLogger) ViewReadTime

func (t *TimeLogger) ViewReadTime() ReadTime

Jump to

Keyboard shortcuts

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