[log] Add debug logging to difc/capabilities.go#1168
Merged
Conversation
Add a debug logger to the Capabilities type to help troubleshoot DIFC tag management operations. Logs are emitted for: - NewCapabilities: creation of a new capabilities set - Add: individual tag additions with tag name - AddAll: bulk tag additions with count - Remove: tag removal with tag name - Clear: clearing all capabilities Follows the pkg:filename logger naming convention used in difc/evaluator.go (logEvaluator) and difc/agent.go (logAgent). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debug logging to the internal/difc/capabilities.go file, following the established logging conventions already in place for other DIFC package files (agent.go and evaluator.go). The logging helps troubleshoot DIFC capability initialization and modifications during agent configuration.
Changes:
- Added debug logger with namespace
difc:capabilitiesfollowing thepackage:componentnaming convention - Added logging to all mutating operations:
NewCapabilities(),Add(),AddAll(),Remove(), andClear()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Adds a debug logger (
logCapabilities) tointernal/difc/capabilities.gofollowing the project'spkg:filenamenaming convention already established in this package.Changes
"github.com/github/gh-aw-mcpg/internal/logger"importvar logCapabilities = logger.New("difc:capabilities")logger declarationNewCapabilities()— logs creation of a new capabilities setAdd(tag)— logs the specific tag being addedAddAll(tags)— logs the count of tags being added in bulkRemove(tag)— logs the specific tag being removedClear()— logs when all capabilities are clearedWhy this file?
The DIFC (Decentralized Information Flow Control) capabilities set manages which tags are globally available in the system. Debug logging here helps troubleshoot:
Follows existing conventions
The
difcpackage already has descriptive logger variables in:evaluator.go:var logEvaluator = logger.New("difc:evaluator")agent.go:var logAgent = logger.New("difc:agent")This PR follows the same pattern with
var logCapabilities = logger.New("difc:capabilities").Testing
Enable with
DEBUG=difc:capabilities ./awmg --config config.toml