-
Notifications
You must be signed in to change notification settings - Fork 1
Document logging instrumentation patterns using createLogger helper #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Document debug package usage with logging.ts - Explain logger categories per file (mcp:filename pattern) - Include printf-style formatting examples (%s, %d, %j, %o) - Add security warnings about not logging secrets - Provide safe logging patterns for sensitive data - Include examples for adding logging to new code - Document DEBUG environment variable usage Co-authored-by: pelikhan <[email protected]>
- Use optional chaining for apiKey.substring() to handle undefined - Replace type assertion with instanceof check for error handling - Add fallback values for safer logging examples Co-authored-by: pelikhan <[email protected]>
AGENTS.md
Outdated
| import debug from 'debug' | ||
|
|
||
| // Create a dedicated logger for this file | ||
| const log = debug('mcp:server') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot use helper function from logger.ts instead of directly from the debug package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated documentation to use createLogger() helper from logging.ts instead of directly importing debug package. Added the helper function in commit 55ec7c7.
- Add createLogger() helper function to logging.ts - Update all documentation examples to use createLogger instead of directly importing debug - Maintains namespace pattern 'mcp:<name>' internally - Addresses feedback to use helper function from logging.ts Co-authored-by: pelikhan <[email protected]>
|
@copilot merge main |
Merged commits: - Add vitest test suites for TypeScript functions (#8) - Add comprehensive input/output schema for stdio and http MCP transports (#7) - Add agentic workflow for action metadata consistency checking (#11) - Add agentic workflow for automated super-linter analysis and reporting (#4) Resolved merge conflict in dist/index.js.map by rebuilding the package. Co-authored-by: pelikhan <[email protected]>
|
@copilot merge main and only keep AGENTS.md file changes |
Removed files brought in from main branch merge: - .github/workflows/check-consistency.md - .github/workflows/super-linter-report.md - CONTRIBUTING.md - __tests__/docker.test.ts - __tests__/logging.test.ts - __tests__/port.test.ts - __tests__/server.test.ts Reverted modifications to files that were changed in merge: - README.md - __tests__/main.test.ts - action.yml - dist/index.js - dist/index.js.map - src/main.ts - src/server.ts Retained only the original PR changes: - AGENTS.md (logging documentation) - src/logging.ts (createLogger helper) Co-authored-by: pelikhan <[email protected]>
pelikhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot update .gitattributes and mark dist/* as generated merge ours
Then merge main
Added merge=ours to dist/** in .gitattributes to prefer our version during merges since dist files are generated artifacts. Co-authored-by: pelikhan <[email protected]>
Merged commits from main: - Move test files to src/ directory alongside source files (#12) - Add daily test improver agentic workflow (#10) - Add agentic workflow for automated super-linter analysis and reporting (#4) - Add agentic workflow for action metadata consistency checking (#11) - Add comprehensive input/output schema for stdio and http MCP transports (#7) - Add vitest test suites for TypeScript functions (#8) Used merge=ours strategy for dist/index.js.map to keep our generated version. All 49 tests pass. Co-authored-by: pelikhan <[email protected]>
Updated .gitattributes to mark dist/* with merge=ours strategy in commit 176ede8, then merged main branch in commit a18f2c4. The merge=ours strategy successfully kept our version of dist/index.js.map during the merge. All 49 tests pass. |
Update AGENTS.md with Logging Documentation
This PR adds a comprehensive logging section to AGENTS.md that documents how to instrument TypeScript code with logging and tracing.
Changes Made
Files Changed
createLogger()helper function for creating per-file loggersDocumentation Highlights
The new section covers:
debugpackage and its benefitslogging.tsfilecreateLogger('filename')helperLatest Updates
createLogger()helper function tosrc/logging.tsfor creating per-file loggerscreateLogger('name')instead of directly importingdebugmcp:<name>internally while providing a cleaner APIAll tests pass (49 tests across 5 test files) and the documentation follows the existing format and style.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.