mirror of
https://github.com/mudler/luet.git
synced 2025-09-06 17:50:34 +00:00
🎨 Allow to pass by a logger interface to context
This commit is contained in:
committed by
GitHub
parent
d6ae727d79
commit
edd2275bf5
@@ -30,7 +30,7 @@ import (
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
*logger.Logger
|
||||
types.Logger
|
||||
context.Context
|
||||
types.GarbageCollector
|
||||
Config *types.LuetConfig
|
||||
@@ -122,13 +122,14 @@ func (c *Context) WithLoggingContext(name string) types.Context {
|
||||
ctxCopy.Config = &configCopy
|
||||
ctxCopy.annotations = ctx.annotations
|
||||
|
||||
ctxCopy.Logger, _ = c.Logger.Copy(logger.WithContext(name))
|
||||
ctxCopy.Logger, _ = c.Logger.Copy()
|
||||
ctxCopy.Logger.SetContext(name)
|
||||
|
||||
return ctxCopy
|
||||
}
|
||||
|
||||
// Copy returns a context copy with a reset logging context
|
||||
func (c *Context) Copy() types.Context {
|
||||
func (c *Context) Clone() types.Context {
|
||||
return c.WithLoggingContext("")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user