Skip to content

Commit e42f96d

Browse files
committed
add controller_id as additional field to the logger
1 parent 19765b3 commit e42f96d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

controller/stackset.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,14 @@ func NewStackSetController(
108108
return nil, err
109109
}
110110

111-
controllerID := "stackset"
111+
logger := log.WithField("controller", "stackset")
112+
112113
if config.ControllerID != "" {
113-
controllerID = config.ControllerID
114+
logger = logger.WithField("controller_id", config.ControllerID)
114115
}
115116

116117
return &StackSetController{
117-
logger: log.WithFields(log.Fields{"controller": controllerID}),
118+
logger: logger,
118119
client: client,
119120
config: config,
120121
stacksetEvents: make(chan stacksetEvent, 1),

0 commit comments

Comments
 (0)