logger

package
v0.1.225 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReflectTypeILogger = di.GetInterfaceReflectType((*ILogger)(nil))

ReflectTypeILogger used when your service claims to implement ILogger

View Source
var ReflectTypeISingletonLogger = di.GetInterfaceReflectType((*ISingletonLogger)(nil))

ReflectTypeISingletonLogger used when your service claims to implement ISingletonLogger

Functions

func AddScopedILogger

func AddScopedILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddScopedILogger adds a type that implements ILogger

func AddScopedILoggerByFunc

func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddScopedILoggerByFunc adds a type by a custom func

func AddScopedILoggerByFuncWithMetadata added in v0.1.217

func AddScopedILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedILoggerByFuncWithMetadata adds a type by a custom func

func AddScopedILoggerWithMetadata added in v0.1.217

func AddScopedILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedILoggerWithMetadata adds a type that implements ILogger

func AddScopedISingletonLogger added in v0.1.166

func AddScopedISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddScopedISingletonLogger adds a type that implements ISingletonLogger

func AddScopedISingletonLoggerByFunc added in v0.1.166

func AddScopedISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddScopedISingletonLoggerByFunc adds a type by a custom func

func AddScopedISingletonLoggerByFuncWithMetadata added in v0.1.217

func AddScopedISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedISingletonLoggerByFuncWithMetadata adds a type by a custom func

func AddScopedISingletonLoggerWithMetadata added in v0.1.217

func AddScopedISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddScopedISingletonLoggerWithMetadata adds a type that implements ISingletonLogger

func AddSingletonILogger

func AddSingletonILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddSingletonILogger adds a type that implements ILogger

func AddSingletonILoggerByFunc

func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddSingletonILoggerByFunc adds a type by a custom func

func AddSingletonILoggerByFuncWithMetadata added in v0.1.217

func AddSingletonILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonILoggerByFuncWithMetadata adds a type by a custom func

func AddSingletonILoggerByObj

func AddSingletonILoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)

AddSingletonILoggerByObj adds a prebuilt obj

func AddSingletonILoggerByObjWithMetadata added in v0.1.217

func AddSingletonILoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonILoggerByObjWithMetadata adds a prebuilt obj

func AddSingletonILoggerWithMetadata added in v0.1.217

func AddSingletonILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonILoggerWithMetadata adds a type that implements ILogger

func AddSingletonISingletonLogger added in v0.1.166

func AddSingletonISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddSingletonISingletonLogger adds a type that implements ISingletonLogger

func AddSingletonISingletonLoggerByFunc added in v0.1.166

func AddSingletonISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddSingletonISingletonLoggerByFunc adds a type by a custom func

func AddSingletonISingletonLoggerByFuncWithMetadata added in v0.1.217

func AddSingletonISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonISingletonLoggerByFuncWithMetadata adds a type by a custom func

func AddSingletonISingletonLoggerByObj added in v0.1.166

func AddSingletonISingletonLoggerByObj(builder *di.Builder, obj interface{}, implementedTypes ...reflect.Type)

AddSingletonISingletonLoggerByObj adds a prebuilt obj

func AddSingletonISingletonLoggerByObjWithMetadata added in v0.1.217

func AddSingletonISingletonLoggerByObjWithMetadata(builder *di.Builder, obj interface{}, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonISingletonLoggerByObjWithMetadata adds a prebuilt obj

func AddSingletonISingletonLoggerWithMetadata added in v0.1.217

func AddSingletonISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddSingletonISingletonLoggerWithMetadata adds a type that implements ISingletonLogger

func AddTransientILogger

func AddTransientILogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddTransientILogger adds a type that implements ILogger

func AddTransientILoggerByFunc

func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddTransientILoggerByFunc adds a type by a custom func

func AddTransientILoggerByFuncWithMetadata added in v0.1.217

func AddTransientILoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientILoggerByFuncWithMetadata adds a type by a custom func

func AddTransientILoggerWithMetadata added in v0.1.217

func AddTransientILoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientILoggerWithMetadata adds a type that implements ILogger

func AddTransientISingletonLogger added in v0.1.166

func AddTransientISingletonLogger(builder *di.Builder, implType reflect.Type, implementedTypes ...reflect.Type)

AddTransientISingletonLogger adds a type that implements ISingletonLogger

func AddTransientISingletonLoggerByFunc added in v0.1.166

func AddTransientISingletonLoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), implementedTypes ...reflect.Type)

AddTransientISingletonLoggerByFunc adds a type by a custom func

func AddTransientISingletonLoggerByFuncWithMetadata added in v0.1.217

func AddTransientISingletonLoggerByFuncWithMetadata(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error), metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientISingletonLoggerByFuncWithMetadata adds a type by a custom func

func AddTransientISingletonLoggerWithMetadata added in v0.1.217

func AddTransientISingletonLoggerWithMetadata(builder *di.Builder, implType reflect.Type, metaData map[string]interface{}, implementedTypes ...reflect.Type)

AddTransientISingletonLoggerWithMetadata adds a type that implements ISingletonLogger

func GetILoggerDefinition added in v0.1.217

func GetILoggerDefinition(ctn di.Container) *di.Def

GetILoggerDefinition returns that last definition registered that this container can provide

func GetILoggerDefinitions added in v0.1.217

func GetILoggerDefinitions(ctn di.Container) []*di.Def

GetILoggerDefinitions returns all definitions that this container can provide

func GetISingletonLoggerDefinition added in v0.1.217

func GetISingletonLoggerDefinition(ctn di.Container) *di.Def

GetISingletonLoggerDefinition returns that last definition registered that this container can provide

func GetISingletonLoggerDefinitions added in v0.1.217

func GetISingletonLoggerDefinitions(ctn di.Container) []*di.Def

GetISingletonLoggerDefinitions returns all definitions that this container can provide

func RemoveAllILogger added in v0.1.144

func RemoveAllILogger(builder *di.Builder)

RemoveAllILogger removes all ILogger from the DI

func RemoveAllISingletonLogger added in v0.1.166

func RemoveAllISingletonLogger(builder *di.Builder)

RemoveAllISingletonLogger removes all ISingletonLogger from the DI

Types

type ILogger

type ILogger interface {
	Error() *zerolog.Event
	Debug() *zerolog.Event
	Fatal() *zerolog.Event
	Info() *zerolog.Event
	Warn() *zerolog.Event
	Trace() *zerolog.Event

	GetLogger() *zerolog.Logger
}

ILogger interface

func GetILoggerFromContainer

func GetILoggerFromContainer(ctn di.Container) ILogger

GetILoggerFromContainer alternative to SafeGetILoggerFromContainer but panics of object is not present

func GetManyILoggerFromContainer added in v0.1.178

func GetManyILoggerFromContainer(ctn di.Container) []ILogger

GetManyILoggerFromContainer alternative to SafeGetManyILoggerFromContainer but panics of object is not present

func SafeGetILoggerFromContainer

func SafeGetILoggerFromContainer(ctn di.Container) (ILogger, error)

SafeGetILoggerFromContainer trys to get the object by type, will not panic, returns nil and error

func SafeGetManyILoggerFromContainer added in v0.1.178

func SafeGetManyILoggerFromContainer(ctn di.Container) ([]ILogger, error)

SafeGetManyILoggerFromContainer trys to get the object by type, will not panic, returns nil and error

type ISingletonLogger added in v0.1.166

type ISingletonLogger interface {
	ILogger
}

ISingletonLogger when you absolutely need a singleton logger

func GetISingletonLoggerFromContainer added in v0.1.166

func GetISingletonLoggerFromContainer(ctn di.Container) ISingletonLogger

GetISingletonLoggerFromContainer alternative to SafeGetISingletonLoggerFromContainer but panics of object is not present

func GetManyISingletonLoggerFromContainer added in v0.1.190

func GetManyISingletonLoggerFromContainer(ctn di.Container) []ISingletonLogger

GetManyISingletonLoggerFromContainer alternative to SafeGetManyISingletonLoggerFromContainer but panics of object is not present

func SafeGetISingletonLoggerFromContainer added in v0.1.166

func SafeGetISingletonLoggerFromContainer(ctn di.Container) (ISingletonLogger, error)

SafeGetISingletonLoggerFromContainer trys to get the object by type, will not panic, returns nil and error

func SafeGetManyISingletonLoggerFromContainer added in v0.1.190

func SafeGetManyISingletonLoggerFromContainer(ctn di.Container) ([]ISingletonLogger, error)

SafeGetManyISingletonLoggerFromContainer trys to get the object by type, will not panic, returns nil and error

Jump to

Keyboard shortcuts

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