Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/auth/oauth/dynamic_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,6 @@ func registerClientDynamicallyWithClient(
return nil, err
}

logger.Infof("Successfully registered OAuth client dynamically - client_id: %s", response.ClientID)
logger.Debugf("Successfully registered OAuth client dynamically - client_id: %s", response.ClientID)
return response, nil
}
4 changes: 2 additions & 2 deletions pkg/auth/oauth/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (f *Flow) Start(ctx context.Context, skipBrowser bool) (*TokenResult, error

// Start the server in a goroutine
go func() {
logger.Infof("Starting OAuth callback server on port %d", f.port)
logger.Debugf("Starting OAuth callback server on port %d", f.port)
if err := f.server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
errorChan <- fmt.Errorf("failed to start callback server: %w", err)
}
Expand Down Expand Up @@ -229,7 +229,7 @@ func (f *Flow) Start(ctx context.Context, skipBrowser bool) (*TokenResult, error
// Wait for token, error, or cancellation
select {
case token := <-tokenChan:
logger.Info("OAuth flow completed successfully")
logger.Debug("OAuth flow completed successfully")
return f.processToken(ctx, token), nil
case err := <-errorChan:
return nil, fmt.Errorf("OAuth flow failed: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/oauth/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func discoverOIDCEndpointsWithClientAndValidation(
// Validate issuer matches before merging
if oauthDoc.Issuer == doc.Issuer {
doc.RegistrationEndpoint = oauthDoc.RegistrationEndpoint
logger.Infof("Found registration_endpoint in OAuth authorization server metadata: %s", doc.RegistrationEndpoint)
logger.Debugf("Found registration_endpoint in OAuth authorization server metadata: %s", doc.RegistrationEndpoint)
} else {
logger.Warnf("Issuer mismatch between OIDC (%s) and OAuth (%s) discovery documents, not merging registration_endpoint",
doc.Issuer, oauthDoc.Issuer)
Expand Down
2 changes: 1 addition & 1 deletion pkg/auth/remote/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (h *Handler) wrapWithPersistence(result *discovery.OAuthFlowResult) oauth2.
if err := h.clientCredentialsPersister(result.ClientID, result.ClientSecret); err != nil {
logger.Warnf("Failed to persist DCR client credentials: %v", err)
} else {
logger.Infof("Successfully persisted DCR client credentials for future restarts")
logger.Debugf("Successfully persisted DCR client credentials for future restarts")
}
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/container/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (c *Client) DeployWorkload(
return 0, fmt.Errorf("failed to create external networks: %w", err)
}
} else {
logger.Infof("Skipping external network creation for custom network mode: %s", permissionConfig.NetworkMode)
logger.Debugf("Skipping external network creation for custom network mode: %s", permissionConfig.NetworkMode)
}

networkIsolation := false
Expand Down Expand Up @@ -804,7 +804,7 @@ func convertRelativePathToAbsolute(source string, mountDecl permissions.MountDec
return "", false
}

logger.Infof("Converting relative path to absolute: %s -> %s", mountDecl, absPath)
logger.Debugf("Converting relative path to absolute: %s -> %s", mountDecl, absPath)
return absPath, true
}

Expand Down Expand Up @@ -1381,7 +1381,7 @@ func (c *Client) createContainer(

func (c *Client) createDnsContainer(ctx context.Context, dnsContainerName string,
attachStdio bool, networkName string, endpointsConfig map[string]*network.EndpointSettings) (string, string, error) {
logger.Infof("Setting up DNS container for %s with image %s...", dnsContainerName, DnsImage)
logger.Debugf("Setting up DNS container for %s with image %s...", dnsContainerName, DnsImage)
dnsLabels := map[string]string{}
lb.AddStandardLabels(dnsLabels, dnsContainerName, dnsContainerName, "stdio", 80)
dnsLabels[ToolhiveAuxiliaryWorkloadLabel] = LabelValueTrue
Expand All @@ -1392,7 +1392,7 @@ func (c *Client) createDnsContainer(ctx context.Context, dnsContainerName string
// Check if the DNS image exists locally before failing
_, inspectErr := c.client.ImageInspect(ctx, DnsImage)
if inspectErr == nil {
logger.Infof("DNS image %s exists locally, continuing despite pull failure", DnsImage)
logger.Debugf("DNS image %s exists locally, continuing despite pull failure", DnsImage)
} else {
return "", "", fmt.Errorf("failed to pull DNS image: %w", err)
}
Expand Down Expand Up @@ -1503,7 +1503,7 @@ func (c *Client) createMcpContainer(
if permissionConfig.NetworkMode != "" && permissionConfig.NetworkMode != "bridge" && permissionConfig.NetworkMode != "default" {
// For custom network modes like "host", "none", etc., don't add any endpoint configurations
// The NetworkMode in hostConfig will handle the networking
logger.Infof("Using custom network mode: %s", permissionConfig.NetworkMode)
logger.Debugf("Using custom network mode: %s", permissionConfig.NetworkMode)
// Leave internalEndpointsConfig as empty map
} else if isolateNetwork {
internalEndpointsConfig[networkName] = &network.EndpointSettings{
Expand Down
4 changes: 2 additions & 2 deletions pkg/container/docker/squid.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func createSquidContainer(
squidConfPath string,
) (string, error) {

logger.Infof("Setting up squid container for %s with image %s...", squidContainerName, getSquidImage())
logger.Debugf("Setting up squid container for %s with image %s...", squidContainerName, getSquidImage())
squidLabels := map[string]string{}
lb.AddStandardLabels(squidLabels, squidContainerName, squidContainerName, "stdio", 80)
squidLabels[ToolhiveAuxiliaryWorkloadLabel] = LabelValueTrue
Expand All @@ -112,7 +112,7 @@ func createSquidContainer(
// Check if the squid image exists locally before failing
_, inspectErr := c.imageManager.ImageExists(ctx, squidImage)
if inspectErr == nil {
logger.Infof("Squid image %s exists locally, continuing despite pull failure", squidImage)
logger.Debugf("Squid image %s exists locally, continuing despite pull failure", squidImage)
} else {
return "", fmt.Errorf("failed to pull squid image: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/mcp/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func New(ctx context.Context, config *Config) (*Server, error) {

// Start starts the MCP server
func (s *Server) Start() error {
logger.Infof("Starting ToolHive MCP server on http://%s:%s/mcp", s.config.Host, s.config.Port)
logger.Debugf("Starting ToolHive MCP server on http://%s:%s/mcp", s.config.Host, s.config.Port)
if err := s.httpServer.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
return fmt.Errorf("MCP server error: %w", err)
}
Expand All @@ -93,7 +93,7 @@ func (s *Server) Start() error {

// Shutdown gracefully shuts down the MCP server
func (s *Server) Shutdown(ctx context.Context) error {
logger.Info("Shutting down MCP server...")
logger.Debug("Shutting down MCP server...")
return s.httpServer.Shutdown(ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/migration/default_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (m *DefaultGroupMigrator) initManagers(ctx context.Context) error {

// createDefaultGroup creates the default group if it doesn't exist
func (m *DefaultGroupMigrator) createDefaultGroup(ctx context.Context) error {
logger.Infof("Creating default group '%s'", groups.DefaultGroupName)
logger.Debugf("Creating default group '%s'", groups.DefaultGroupName)
if err := m.groupManager.Create(ctx, groups.DefaultGroupName); err != nil {
return fmt.Errorf("failed to create default group: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/migration/telemetry_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func performTelemetryConfigMigration() error {
}

if migratedCount > 0 {
logger.Infof("Successfully migrated telemetry config for %d workload(s)", migratedCount)
logger.Debugf("Successfully migrated telemetry config for %d workload(s)", migratedCount)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ func promptForEnvironmentVariable(envVar *registry.EnvVar) (string, error) {
var byteValue []byte
var err error
if envVar.Secret {
logger.Infof("Required secret environment variable: %s (%s)", envVar.Name, envVar.Description)
fmt.Printf("Required secret environment variable: %s (%s)", envVar.Name, envVar.Description)
fmt.Printf("Enter value for %s (input will be hidden): ", envVar.Name)
byteValue, err = term.ReadPassword(int(os.Stdin.Fd()))
fmt.Println() // Move to the next line after hidden input
} else {
logger.Infof("Required environment variable: %s (%s)", envVar.Name, envVar.Description)
fmt.Printf("Required environment variable: %s (%s)", envVar.Name, envVar.Description)
fmt.Printf("Enter value for %s: ", envVar.Name)
// For non-secret input, we can use a simple fmt.Scanln or bufio.Scanner
var input string
Expand Down
4 changes: 2 additions & 2 deletions pkg/telemetry/providers/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func NewCompositeProvider(

// Early return for no-op case
if selector.IsFullyNoOp() {
logger.Infof("No telemetry configured, using no-op providers")
logger.Debugf("No telemetry configured, using no-op providers")
return createNoOpProvider(), nil
}

Expand Down Expand Up @@ -222,7 +222,7 @@ func buildProviders(
return nil, err
}

logger.Infof("Telemetry providers created successfully")
logger.Debugf("Telemetry providers created successfully")
return composite, nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/telemetry/providers/providers_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (*OTLPTracerStrategy) CreateTracerProvider(
config Config,
res *resource.Resource,
) (trace.TracerProvider, func(context.Context) error, error) {
logger.Infof("Creating OTLP tracer provider for endpoint: %s with sampling rate: %.2f",
logger.Debugf("Creating OTLP tracer provider for endpoint: %s with sampling rate: %.2f",
config.OTLPEndpoint, config.SamplingRate)

otlpConfig := otlp.Config{
Expand Down Expand Up @@ -117,7 +117,7 @@ func (s *UnifiedMeterStrategy) CreateMeterProvider(

// Add OTLP reader if enabled
if s.EnableOTLP {
logger.Infof("Adding OTLP metrics reader for endpoint: %s", config.OTLPEndpoint)
logger.Debugf("Adding OTLP metrics reader for endpoint: %s", config.OTLPEndpoint)

otlpConfig := otlp.Config{
Endpoint: config.OTLPEndpoint,
Expand All @@ -135,7 +135,7 @@ func (s *UnifiedMeterStrategy) CreateMeterProvider(

// Add Prometheus reader if enabled
if s.EnablePrometheus {
logger.Infof("Adding Prometheus metrics reader")
logger.Debugf("Adding Prometheus metrics reader")
promConfig := prometheus.Config{
EnableMetricsPath: true,
IncludeRuntimeMetrics: true,
Expand Down Expand Up @@ -193,7 +193,7 @@ func (s *StrategySelector) SelectTracerStrategy() TracerStrategy {

// Log informational message when endpoint is configured but tracing is disabled
if hasEndpoint && !tracingEnabled {
logger.Infof("OTLP endpoint configured but tracing is disabled")
logger.Debugf("OTLP endpoint configured but tracing is disabled")
}

return &NoOpTracerStrategy{}
Expand Down
12 changes: 6 additions & 6 deletions pkg/transport/proxy/httpsse/http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (p *HTTPSSEProxy) Start(_ context.Context) error {
// Add Prometheus metrics endpoint if handler is provided (no middlewares)
if p.prometheusHandler != nil {
mux.Handle("/metrics", p.prometheusHandler)
logger.Info("Prometheus metrics endpoint enabled at /metrics")
logger.Debug("Prometheus metrics endpoint enabled at /metrics")
}

// Create a listener to get the actual port when using port 0
Expand Down Expand Up @@ -188,9 +188,9 @@ func (p *HTTPSSEProxy) Start(_ context.Context) error {
_, portStr, _ := net.SplitHostPort(actualAddr)
actualPort, _ := strconv.Atoi(portStr)

logger.Infof("HTTP proxy started on port %d", actualPort)
logger.Infof("SSE endpoint: http://%s%s", actualAddr, ssecommon.HTTPSSEEndpoint)
logger.Infof("JSON-RPC endpoint: http://%s%s", actualAddr, ssecommon.HTTPMessagesEndpoint)
logger.Debugf("HTTP proxy started on port %d", actualPort)
logger.Debugf("SSE endpoint: http://%s%s", actualAddr, ssecommon.HTTPSSEEndpoint)
logger.Debugf("JSON-RPC endpoint: http://%s%s", actualAddr, ssecommon.HTTPMessagesEndpoint)

if err := p.server.Serve(listener); err != nil && !errors.Is(err, http.ErrServerClosed) {
logger.Errorf("HTTP server error: %v", err)
Expand Down Expand Up @@ -340,7 +340,7 @@ func (p *HTTPSSEProxy) handleSSEConnection(w http.ResponseWriter, r *http.Reques
go func() {
<-ctx.Done()
p.removeClient(clientID)
logger.Infof("Client %s disconnected", clientID)
logger.Debugf("Client %s disconnected", clientID)
}()

// Send messages to the client
Expand Down Expand Up @@ -406,7 +406,7 @@ func (p *HTTPSSEProxy) handlePostRequest(w http.ResponseWriter, r *http.Request)
}

// Log the message
logger.Infof("Received JSON-RPC message: %T", msg)
logger.Debugf("Received JSON-RPC message: %T", msg)

// Send the message to the destination
if err := p.SendMessageToDestination(msg); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/transport/proxy/streamable/streamable_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func (p *HTTPProxy) Start(_ context.Context) error {
go p.dispatchResponses()

go func() {
logger.Infof("Streamable HTTP proxy started on port %d", p.port)
logger.Infof("Streamable HTTP endpoint: http://%s:%d%s", p.host, p.port, StreamableHTTPEndpoint)
logger.Debugf("Streamable HTTP proxy started on port %d", p.port)
logger.Debugf("Streamable HTTP endpoint: http://%s:%d%s", p.host, p.port, StreamableHTTPEndpoint)
if err := p.server.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
logger.Errorf("Streamable HTTP server error: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/transport/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ func (t *StdioTransport) handleContainerExit(ctx context.Context) {

// Check if container was removed (not just exited) using typed error
if errors.Is(err, docker.ErrContainerRemoved) {
logger.Infof("Container %s was removed. Stopping proxy and cleaning up.", t.containerName)
logger.Debugf("Container %s was removed. Stopping proxy and cleaning up.", t.containerName)
} else {
logger.Infof("Container %s exited. Will attempt automatic restart.", t.containerName)
logger.Debugf("Container %s exited. Will attempt automatic restart.", t.containerName)
}

// Check if the transport is already stopped before trying to stop it
Expand Down
Loading