@@ -14,6 +14,7 @@ import (
1414 "github.com/docker/mcp-gateway/pkg/docker"
1515 "github.com/docker/mcp-gateway/pkg/eval"
1616 "github.com/docker/mcp-gateway/pkg/gateway/proxies"
17+ "github.com/docker/mcp-gateway/pkg/log"
1718 mcpclient "github.com/docker/mcp-gateway/pkg/mcp"
1819)
1920
@@ -165,23 +166,23 @@ func (cp *clientPool) InvalidateOAuthClients(provider string) {
165166 cp .clientLock .Lock ()
166167 defer cp .clientLock .Unlock ()
167168
168- log (fmt .Sprintf ("ClientPool: Invalidating OAuth clients for provider: %s" , provider ))
169+ log . Log (fmt .Sprintf ("ClientPool: Invalidating OAuth clients for provider: %s" , provider ))
169170
170171 var invalidatedKeys []clientKey
171172 for key , keptClient := range cp .keptClients {
172173 // Check if this client uses OAuth for the specified provider
173174 if keptClient .Config .Spec .OAuth != nil {
174175 // Match by server name (for DCR providers, server name matches provider)
175176 if keptClient .Config .Name == provider {
176- log (fmt .Sprintf ("ClientPool: Closing OAuth connection for server: %s" , keptClient .Config .Name ))
177+ log . Log (fmt .Sprintf ("ClientPool: Closing OAuth connection for server: %s" , keptClient .Config .Name ))
177178
178179 // Close the connection
179180 client , err := keptClient .Getter .GetClient (context .TODO ())
180181 if err == nil {
181182 client .Session ().Close ()
182- log (fmt .Sprintf ("ClientPool: Successfully closed connection for %s" , keptClient .Config .Name ))
183+ log . Log (fmt .Sprintf ("ClientPool: Successfully closed connection for %s" , keptClient .Config .Name ))
183184 } else {
184- log (fmt .Sprintf ("ClientPool: Warning - failed to get client for %s during invalidation: %v" , keptClient .Config .Name , err ))
185+ log . Log (fmt .Sprintf ("ClientPool: Warning - failed to get client for %s during invalidation: %v" , keptClient .Config .Name , err ))
185186 }
186187
187188 // Mark for removal from kept clients
@@ -196,9 +197,9 @@ func (cp *clientPool) InvalidateOAuthClients(provider string) {
196197 }
197198
198199 if len (invalidatedKeys ) > 0 {
199- log (fmt .Sprintf ("ClientPool: Invalidated %d OAuth connections for provider %s" , len (invalidatedKeys ), provider ))
200+ log . Log (fmt .Sprintf ("ClientPool: Invalidated %d OAuth connections for provider %s" , len (invalidatedKeys ), provider ))
200201 } else {
201- log (fmt .Sprintf ("ClientPool: No active OAuth connections found for provider %s" , provider ))
202+ log . Log (fmt .Sprintf ("ClientPool: No active OAuth connections found for provider %s" , provider ))
202203 }
203204}
204205
@@ -240,7 +241,7 @@ func (cp *clientPool) runToolContainer(ctx context.Context, tool catalog.Tool, p
240241 command := eval .EvaluateList (tool .Container .Command , arguments )
241242 args = append (args , command ... )
242243
243- log (" - Running container" , tool .Container .Image , "with args" , args )
244+ log . Log (" - Running container" , tool .Container .Image , "with args" , args )
244245
245246 cmd := exec .CommandContext (ctx , "docker" , args ... )
246247 if cp .Verbose {
@@ -325,7 +326,7 @@ func (cp *clientPool) argsAndEnv(serverConfig *catalog.ServerConfig, readOnly *b
325326 if ok {
326327 env = append (env , fmt .Sprintf ("%s=%s" , s .Env , secretValue ))
327328 } else {
328- logf ("Warning: Secret '%s' not found for server '%s', setting %s=<UNKNOWN>" , s .Name , serverConfig .Name , s .Env )
329+ log . Logf ("Warning: Secret '%s' not found for server '%s', setting %s=<UNKNOWN>" , s .Name , serverConfig .Name , s .Env )
329330 env = append (env , fmt .Sprintf ("%s=%s" , s .Env , "<UNKNOWN>" ))
330331 }
331332 }
@@ -446,9 +447,9 @@ func (cg *clientGetter) GetClient(ctx context.Context) (mcpclient.Client, error)
446447
447448 command := expandEnvList (eval .EvaluateList (cg .serverConfig .Spec .Command , cg .serverConfig .Config ), env )
448449 if len (command ) == 0 {
449- log (" - Running" , imageBaseName (image ), "with" , args )
450+ log . Log (" - Running" , imageBaseName (image ), "with" , args )
450451 } else {
451- log (" - Running" , imageBaseName (image ), "with" , args , "and command" , command )
452+ log . Log (" - Running" , imageBaseName (image ), "with" , args , "and command" , command )
452453 }
453454
454455 var runArgs []string
0 commit comments