Skip to content

Conversation

@tomas-martins-crossmint
Copy link
Contributor

This pull request adds comprehensive wallet logging to match the web SDK, updates the structure for logs sent to DataDog, and replaces OSLogType with a custom LogLevel type

New Logging Coverage

Added new log event constants and implemented logging across:

  • DefaultSmartWalletService requests: createWallet, getWallet, transferToken
  • SDK Initializer: Initial wallet service setup
  • EVM Wallet: sendTransaction, signMessage, signTypedData
  • Solana Wallet: sendTransaction
  • Wallet Operations: approve
  • Wallet Factory: Invalid chain error scenarios

All logs follow a three-phase pattern from the web SDK, (startsuccess/error) with contextual metadata (transaction IDs, addresses, chain types, error messages)

Structured Logging

Updated DataDogLoggerProvider and OSLoggerProvider to format messages with key=value pairs:

// Output: "evmWallet.sendTransaction.success transactionId=abc123 hash=0x456def"
Logger.smartWallet.info(LogEvents.evmSendTransactionSuccess, attributes: [
    "transactionId": transaction.id,
    "hash": transaction.onChain?.txId ?? ""
])

DataDog now receives formatted message strings only (with base service/platform attributes), which will be formatted into proper metadata on DataDog through a grok parser we'll implement for the mobile SDK

Custom LogLevel Enum

Replaced OSLogType with a custom LogLevel enum containing only the four levels from LoggerProvider:

let sdk = CrossmintSDK.shared(
    apiKey: apiKey,
    logLevel: .debug  // LogLevel (.debug, .info, .warn, .error)
)

The default level changed from .default to .error

@tomas-martins-crossmint tomas-martins-crossmint changed the title Tomas/wal 7804 add remaining wallet logs to match web sdk coverage Added new logs and improved coverage for Wallets operations Dec 11, 2025
…-sdk-coverage

Resolved conflicts by combining:
- Logging statements from current branch
- Idempotency key functionality from PR #41
@tomas-martins-crossmint tomas-martins-crossmint merged commit e1f7d54 into main Dec 15, 2025
2 of 3 checks passed
@tomas-martins-crossmint tomas-martins-crossmint deleted the tomas/wal-7804-add-remaining-wallet-logs-to-match-web-sdk-coverage branch December 15, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants