flamingo

package
v0.0.0-...-fd23dd1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: OSL-3.0 Imports: 11 Imported by: 44

Documentation

Index

Constants

View Source
const (
	LogKeyAccesslog         LogKey = "accesslog" // LogKeyAccesslog marks a logmessage belonging to an (incoming) call (value should be 1)
	LogKeyApicall                  = "apicall"   // LogKeyApicall marks a logmessage belonging to an (outgoing) api call (value should be 1)
	LogKeyArea                     = "area"
	LogKeyBusinessID               = "businessId"
	LogKeyCategory                 = "category"
	LogKeySubCategory              = "sub_category"
	LogKeyClientIP                 = "client_ip"
	LogKeyCode                     = "code"
	LogKeyConnectionStatus         = "connection_status"
	LogKeyCorrelationID            = "correlationId"
	LogKeyLevel                    = "level"
	LogKeyMessage                  = "message"
	LogKeyMethod                   = "method"
	LogKeyPath                     = "path"
	LogKeyReferer                  = "referer"
	LogKeyRequest                  = "request"
	LogKeyRequestTime              = "request_time"
	LogKeyRequestedEndpoint        = "requested_endpoint"
	LogKeyRequestedURL             = "requested_url"
	LogKeyResponse                 = "response"
	LogKeyResponseCode             = "response_code"
	LogKeyResponseTime             = "response_time"
	LogKeySource                   = "source"
	LogKeyTimestamp                = "@timestamp"
	LogKeyTrace                    = "trace"
)

Common logger field keys

Variables

This section is empty.

Functions

func App

func App(root *config.Area, configdir string)

App is a simple app-runner for flamingo

Types

type AppShutdownEvent

type AppShutdownEvent struct {
	AppModule dingo.Module
}

AppShutdownEvent is dispatched on app shutdown

type AppStartupEvent

type AppStartupEvent struct {
	AppModule dingo.Module
}

AppShutdownEvent is dispatched on app startup

type LogKey

type LogKey string

LogKey is a logging key constant

type Logger

type Logger interface {
	WithContext(ctx context.Context) Logger

	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Fatal(args ...interface{})
	Panic(args ...interface{})

	Debugf(log string, args ...interface{})

	WithField(key LogKey, value interface{}) Logger
	WithFields(fields map[LogKey]interface{}) Logger

	Flush()
}

Logger defines a standard Flamingo logger interfaces

type NullLogger

type NullLogger struct{}

NullLogger does not log

func (NullLogger) Debug

func (NullLogger) Debug(args ...interface{})

Debug null-implementation

func (NullLogger) Debugf

func (NullLogger) Debugf(log string, args ...interface{})

Debugf null-implementation

func (NullLogger) Error

func (NullLogger) Error(args ...interface{})

Error null-implementation

func (NullLogger) Fatal

func (NullLogger) Fatal(args ...interface{})

Fatal null-implementation

func (NullLogger) Flush

func (n NullLogger) Flush()

Flush null-implementation

func (NullLogger) Info

func (NullLogger) Info(args ...interface{})

Info null-implementation

func (NullLogger) Panic

func (NullLogger) Panic(args ...interface{})

Panic null-implementation

func (NullLogger) Warn

func (NullLogger) Warn(args ...interface{})

Warn null-implementation

func (NullLogger) WithContext

func (n NullLogger) WithContext(ctx context.Context) Logger

WithContext null-implementation

func (NullLogger) WithField

func (n NullLogger) WithField(key LogKey, value interface{}) Logger

WithField null-implementation

func (NullLogger) WithFields

func (n NullLogger) WithFields(fields map[LogKey]interface{}) Logger

WithFields null-implementation

type StdLogger

type StdLogger struct {
	log.Logger
}

StdLogger uses the go stdlib logger for logging

func (*StdLogger) Debug

func (l *StdLogger) Debug(args ...interface{})

Debug logs output

func (*StdLogger) Debugf

func (l *StdLogger) Debugf(f string, args ...interface{})

Debugf outputs the formatted debug string

func (*StdLogger) Error

func (l *StdLogger) Error(args ...interface{})

Error log

func (*StdLogger) Flush

func (l *StdLogger) Flush()

Flush does nothing

func (*StdLogger) Info

func (l *StdLogger) Info(args ...interface{})

Info log output

func (*StdLogger) Warn

func (l *StdLogger) Warn(args ...interface{})

Warn log output

func (*StdLogger) WithContext

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

WithContext currently does nothing

func (*StdLogger) WithField

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

WithField currently logs the field

func (*StdLogger) WithFields

func (l *StdLogger) WithFields(fields map[LogKey]interface{}) Logger

WithFields currently logs the fields

Directories

Path Synopsis
Package mocks is autogenerated Code generated by mockery v1.0.0
Package mocks is autogenerated Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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