Add User-Agent header, logging support, and storage admin helpers#2
Merged
Add User-Agent header, logging support, and storage admin helpers#2
Conversation
- Add InsForge-Python/{VERSION} User-Agent to all HTTP requests
- Read version from package metadata (importlib.metadata) to keep
pyproject.toml as single source of truth
- Add logging module with setup_logging() helper for INFO/DEBUG levels
- INFO: SDK initialization config; DEBUG: HTTP request/response details
- Document logging usage in README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Redact password, token, otp, code, api_key and other credentials from request body before writing to debug logs. Co-Authored-By: Claude Opus 4.6 (1M context) <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
InsForge-Python/{VERSION}User-Agent header to all HTTP requests, matching the pattern used in Kotlin/Swift/Go SDKsimportlib.metadata) sopyproject.tomlremains the single source of truthinsforge.setup_logging()helper with INFO (SDK config) and DEBUG (HTTP request/response) levelsTest plan
insforge.setup_logging("DEBUG")prints HTTP request/response detailsinsforge.setup_logging("INFO")prints SDK initialization info🤖 Generated with Claude Code
Note
Add User-Agent header, logging support, and storage debug logging to the insforge SDK
User-Agentheader of the formInsForge-Python/{VERSION}; passinguser-agentinextra_headersis silently ignored.insforge.setup_logging(level)to configure theinsforgelogger with aStreamHandler, making it easy to enable INFO or DEBUG output without custom logging setup.BaseClient._requestandStorageClientmethods, emitting method, URL, params, and status code; request bodies are logged with sensitive fields redacted.user-agentis now a reserved header and cannot be overridden viaextra_headers.Macroscope summarized a1328df.