Skip to content
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

feat: Add Logger type to UniversalProviderOpts.logger #4592

Closed
dougEfresh opened this issue Jun 7, 2024 · 2 comments
Closed

feat: Add Logger type to UniversalProviderOpts.logger #4592

dougEfresh opened this issue Jun 7, 2024 · 2 comments

Comments

@dougEfresh
Copy link
Contributor

Is your feature request related to a problem? Please describe.

UniversalProviderOpts has a logger option which is of type string.
However, the constructor code for the UniversalProvider also accepts a Logger pino type

    this.logger =
      typeof opts?.logger !== "undefined" && typeof opts?.logger !== "string"
        ? opts.logger
        : pino(getDefaultLoggerOptions({ level: opts?.logger || LOGGER }));

It would be convenient for a Logger type to be passed to UniversalProvider.

Describe the solution you'd like

Add Logger type:

diff --git a/providers/universal-provider/src/types/misc.ts b/providers/universal-provider/src/types/misc.ts
index ac17039e..2d62dd5a 100644
--- a/providers/universal-provider/src/types/misc.ts
+++ b/providers/universal-provider/src/types/misc.ts
@@ -3,13 +3,13 @@ import { SignClientTypes, ProposalTypes, AuthTypes } from "@walletconnect/types"
 import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider";
 import { KeyValueStorageOptions, IKeyValueStorage } from "@walletconnect/keyvaluestorage";
 import { IEvents } from "@walletconnect/events";
-
+import { Logger } from "@walletconnect/logger";
 import { IProvider } from "./providers";
 
 export interface UniversalProviderOpts {
   projectId?: string;
   metadata: Metadata;
-  logger?: string;
+  logger?: string | Logger;
   client?: SignClient;
   relayUrl?: string;
   storageOptions?: KeyValueStorageOptions;
Copy link

linear bot commented Jun 7, 2024

@dougEfresh
Copy link
Contributor Author

dougEfresh commented Jun 7, 2024

See core types

which has string | Logger

@bkrem bkrem closed this as completed in 6653afa Jun 11, 2024
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

No branches or pull requests

1 participant