Skip to content

fix: replace direct console.* calls with walletsLogger in wallets package#1592

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771608408-wallets-use-sdk-logger
Open

fix: replace direct console.* calls with walletsLogger in wallets package#1592
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1771608408-wallets-use-sdk-logger

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 20, 2026

Description

Part of the effort to make consoleLogLevel="silent" work across all SDK packages. Three direct console.* calls in the wallets package were bypassing the SdkLogger system, meaning they'd still appear even when a consumer sets consoleLogLevel="silent" on CrossmintProvider.

This replaces them with walletsLogger:

  • ncs-iframe-manager.ts: 2× console.infowalletsLogger.info (iframe init lifecycle)
  • wallet.ts: 1× console.warnwalletsLogger.warn (deprecated approveTransaction method)

Requested by: @xmint-guille
Link to Devin run

Test plan

  • Existing tests cover wallets functionality; no behavioral change beyond log routing
  • Reviewer should verify walletsLogger is initialized before NcsIframeManager.initialize() runs — if it isn't, SdkLogger falls back to raw console.* anyway, so logs would still leak in that edge case

Package updates

  • @crossmint/wallets-sdk: patch — changeset added via .changeset/wallets-use-sdk-logger.md

Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: 902c517

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@crossmint/wallets-sdk Patch
expo-demo Patch
@crossmint/client-sdk-react-base Patch
@crossmint/client-sdk-react-native-ui Patch
@crossmint/client-sdk-react-ui Patch
@crossmint/auth-ssr-nextjs-demo Patch
@crossmint/client-sdk-nextjs-starter Patch
@crossmint/wallets-quickstart-devkit Patch

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

@devin-ai-integration
Copy link
Contributor Author

Original prompt from Guille
we introduced the following change here to supress logs in our sdks:
https://github.com/Crossmint/crossmint-sdk/commit/27194e5751fd4bb3afb190550382760f978d7a20

i've tried this with the following code snippet, and I can still see logs once I'm logged in:
```ts
"use client";

import {
  CrossmintProvider,
  CrossmintAuthProvider,
  CrossmintWalletProvider,
  useAuth,
  useWallet,
} from "@crossmint/client-sdk-react-ui";

function WalletUser() {
  const { login, user } = useAuth();
  const { wallet, status } = useWallet();

  return (
    <div>
      {user == null ? (
        <button onClick={login}>Sign In</button>
      ) : (
        <p>
          Wallet: {wallet?.address} ({status})
        </p>
      )}
    </div>
  );
}

export default function Page() {
  return (
    <CrossmintProvider
      apiKey={process.env.NEXT_PUBLIC_CLIENT_API_KEY ?? ""}
      consoleLogLevel="silent"
    >
      <CrossmintAuthProvider>
        <CrossmintWalletProvider
          createOnLogin={{
            chain: "polygon-amoy",
            signer: { type: "email" },
          }}
        >
          <WalletUser />
        </CrossmintWalletProvider>
      </CrossmintAuthProvider>
    </CrossmintProvider>
  );
}

can you determine the issue and propose a PR in case it's feasible to maintain the silent logs flag in every part of our sdks?

</details>

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions
Copy link
Contributor

🔥 Smoke Test Results

Status: Passed

Statistics

  • Total Tests: 5
  • Passed: 5 ✅
  • Failed: 0
  • Skipped: 0
  • Duration: 5.00 min

✅ All smoke tests passed!

All critical flows are working correctly.


This is a non-blocking smoke test. Full regression tests run separately.

Copy link
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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.

1 participant