Documentation ¶
Index ¶
- Variables
- func AddScopedILogger(builder *di.Builder, implType reflect.Type)
- func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILogger(builder *di.Builder, implType reflect.Type)
- func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func AddSingletonILoggerByObj(builder *di.Builder, obj interface{})
- func AddTransientILogger(builder *di.Builder, implType reflect.Type)
- func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, ...)
- func RemoveAllILogger(builder *di.Builder)
- type ILogger
Constants ¶
This section is empty.
Variables ¶
var ReflectTypeILogger = di.GetInterfaceReflectType((*ILogger)(nil))
ReflectTypeILogger used when your service claims to implement ILogger
Functions ¶
func AddScopedILogger ¶
AddScopedILogger adds a type that implements ILogger
func AddScopedILoggerByFunc ¶
func AddScopedILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddScopedILoggerByFunc adds a type by a custom func
func AddSingletonILogger ¶
AddSingletonILogger adds a type that implements ILogger
func AddSingletonILoggerByFunc ¶
func AddSingletonILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddSingletonILoggerByFunc adds a type by a custom func
func AddSingletonILoggerByObj ¶
AddSingletonILoggerByObj adds a prebuilt obj
func AddTransientILogger ¶
AddTransientILogger adds a type that implements ILogger
func AddTransientILoggerByFunc ¶
func AddTransientILoggerByFunc(builder *di.Builder, implType reflect.Type, build func(ctn di.Container) (interface{}, error))
AddTransientILoggerByFunc adds a type by a custom func
func RemoveAllILogger ¶ added in v0.1.144
RemoveAllILogger removes all ILogger 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 ¶
GetILoggerFromContainer alternative to SafeGetILoggerFromContainer but panics of object is not present
func GetManyILoggerFromContainer ¶ added in v0.1.178
GetManyILoggerFromContainer alternative to SafeGetManyILoggerFromContainer but panics of object is not present
func SafeGetILoggerFromContainer ¶
SafeGetILoggerFromContainer trys to get the object by type, will not panic, returns nil and error