Merged
Conversation
🦋 Changeset detectedLatest commit: 9969ec9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
This PR adds a comprehensive, production-ready logging system to Graz with support for multiple log levels, category filtering, performance timing, error tracking integration, and colored console output.
Features
🎯 Core Logging System
🎨 Developer Experience
⚙️ Configuration
GrazProviderwithloggeroptionsconfigureLogger()orgetLogger()for dynamic controlwindow.__GRAZ_DEBUG__ = trueto force enable logging📝 Implementation
LogLevelandLogCategoryenumsLOG_FUNCTIONSandLOG_HOOKSfor consistent namingGrazInternalStoreUsage
Basic Setup
Environment-based Configuration
Dynamic Control
Logging Coverage
Logging has been integrated across the entire codebase:
Actions
connect()- Full connection lifecycle with performance timingdisconnect()- Disconnection trackingreconnect()- Reconnection attempts and failuressendTokens()- Transaction signing and broadcastingsendIbcTokens()- IBC transfersexecuteContract()- Contract executioninstantiateContract()- Contract instantiationHooks
useConnect()- Connection mutation logginguseDisconnect()- Disconnection mutation logginguseSendTokens()- Transaction mutation logginguseExecuteContract()- Contract execution logginguseStargateClient()- Client creation logginguseCosmWasmClient()- CosmWasm client loggingUtilities
createMultiChainAsyncFunction()- Multi-chain operation timing and trackingDocumentation
Added Files
docs/docs/guides/logging-and-debugging.md(478 lines)packages/graz/src/types/logger.ts(99 lines)LogLevelenumLogCategoryenumLoggerinterfaceLoggerOptionsinterfaceErrorReporterinterfacepackages/graz/src/utils/logger.ts(317 lines)GrazLoggerclass implementationgetLogger()andconfigureLogger()packages/graz/src/constant.ts(updated)LOG_CATEGORIESconstantLOG_FUNCTIONSconstant (all function names)LOG_HOOKSconstant (all hook names)Testing
Test Coverage
✅ 41 tests covering all logger functionality
Test Categories:
Note: Tests use a standalone
TestGrazLoggerclass to work around Vitest 2.x SSR bug with enum imports.Breaking Changes
Previous Behavior: No logging system existed
New Behavior: Logger exists but is disabled by default
logger: { enabled: true }ingrazOptionsto enablewindow.__GRAZ_DEBUG__ = truefor debuggingThis is intentional to give developers full control over logging in their applications.
Examples
Development Logging
Production Error Tracking
Filtered Logging
Visual Output
Logs appear in the browser console with colored formatting:
Migration Guide
No breaking changes for existing users. The logger is opt-in and requires explicit configuration to enable.
To Enable Logging
Checklist
Related Issues
Closes #[issue-number] (if applicable)
Additional Notes
The logger system is designed to be:
This provides a solid foundation for debugging and monitoring Graz applications in both development and production environments.