Move logger implementation to toolhive-core#3616
Open
niveshdandyan wants to merge 1 commit intostacklok:mainfrom
Open
Move logger implementation to toolhive-core#3616niveshdandyan wants to merge 1 commit intostacklok:mainfrom
niveshdandyan wants to merge 1 commit intostacklok:mainfrom
Conversation
Refactors the logger package to use the shared logger from toolhive-core, while maintaining backward compatibility with the existing API. Changes: - Logger implementation now delegates to github.com/stacklok/toolhive-core/logger - Introduces viperDebugProvider for viper integration with the core logger - Maintains all existing function signatures for backward compatibility - Updates tests to work with the new implementation The logger package in toolhive now serves as a thin wrapper that: 1. Re-exports all logging functions from toolhive-core 2. Provides viper-based debug configuration via DebugProvider interface 3. Preserves the Initialize() API that uses viper for debug flag This enables logger code reuse across ToolHive Runtime and Registry while keeping project-specific configuration (viper) in each project. Fixes stacklok#3614 Co-Authored-By: Claude (claude-opus-4-5) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the shared logger package implementation to toolhive-core for better code organization and reuse across ToolHive projects. Both ToolHive Runtime and Registry rely on structured logging and this change enables convergence on a common logging format.
Fixes #3614
Changes
github.com/stacklok/toolhive-core/loggerDebugProviderinterface in toolhive-core for configurable debug modeviperDebugProviderin toolhive for viper-based debug configurationArchitecture
The logger package now follows a thin-wrapper pattern:
This design:
Testing
go build ./...succeedsgo test ./...passes (if applicable)Note: This PR depends on the logger package being added to toolhive-core.
A corresponding PR has been prepared at: https://github.com/niveshdandyan/toolhive-core/tree/feat/add-logger-package
AI Transparency
This PR was created with the assistance of AI (Claude by Anthropic) for code generation and review.