Skip to content

Commit

Permalink
Merge pull request #1616 from WalletConnect/chore/pino
Browse files Browse the repository at this point in the history
chore: logger update
  • Loading branch information
ganchoradkov authored Nov 10, 2022
2 parents 77a65f0 + facf41c commit 1170770
Show file tree
Hide file tree
Showing 42 changed files with 2,366 additions and 19,446 deletions.
4,922 changes: 2,325 additions & 2,597 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"@rollup/plugin-commonjs": "22.0.2",
"@rollup/plugin-node-resolve": "13.3.0",
"@types/node": "18.7.3",
"@types/pino": "6.3.3",
"@types/sinon": "10.0.13",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
Expand Down
4 changes: 1 addition & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@
"@walletconnect/jsonrpc-utils": "1.0.3",
"@walletconnect/jsonrpc-ws-connection": "1.0.3",
"@walletconnect/keyvaluestorage": "1.0.1-rc.2",
"@walletconnect/logger": "1.0.1",
"@walletconnect/logger": "2.0.0",
"@walletconnect/relay-api": "1.0.6",
"@walletconnect/relay-auth": "1.0.3",
"@walletconnect/safe-json": "1.0.0",
"@walletconnect/time": "1.0.1",
"@walletconnect/types": "2.1.1",
"@walletconnect/utils": "2.1.1",
"lodash.isequal": "4.5.0",
"pino": "6.7.0",
"pino-pretty": "4.3.0",
"uint8arrays": "3.1.0"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { safeJsonParse, safeJsonStringify } from "@walletconnect/safe-json";
import { ICore, ICrypto, IKeyChain } from "@walletconnect/types";
import * as relayAuth from "@walletconnect/relay-auth";
Expand All @@ -17,7 +17,6 @@ import {
deserialize,
decodeTypeByte,
} from "@walletconnect/utils";
import { Logger } from "pino";
import { CRYPTO_CONTEXT, CRYPTO_CLIENT_SEED, CRYPTO_JWT_TTL } from "../constants";
import { KeyChain } from "./keychain";

Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/expirer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { HEARTBEAT_EVENTS } from "@walletconnect/heartbeat";
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { toMiliseconds } from "@walletconnect/time";
import { ExpirerTypes, ICore, IExpirer } from "@walletconnect/types";
import { getInternalError, formatIdTarget, formatTopicTarget } from "@walletconnect/utils";
import { EventEmitter } from "events";
import { Logger } from "pino";
import {
CORE_STORAGE_PREFIX,
EXPIRER_CONTEXT,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/history.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { formatJsonRpcRequest, isJsonRpcError } from "@walletconnect/jsonrpc-utils";
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { IJsonRpcHistory, JsonRpcRecord, RequestEvent, ICore } from "@walletconnect/types";
import { getInternalError } from "@walletconnect/utils";
import { EventEmitter } from "events";
import { Logger } from "pino";
import {
CORE_STORAGE_PREFIX,
HISTORY_CONTEXT,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/keychain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Logger } from "pino";
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { ICore, IKeyChain } from "@walletconnect/types";
import { getInternalError, mapToObj, objToMap } from "@walletconnect/utils";

Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/messages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { ICore, IMessageTracker, MessageRecord } from "@walletconnect/types";
import { hashMessage, mapToObj, objToMap, getInternalError } from "@walletconnect/utils";
import { Logger } from "pino";
import { CORE_STORAGE_PREFIX, MESSAGES_CONTEXT, MESSAGES_STORAGE_VERSION } from "../constants";

export class MessageTracker extends IMessageTracker {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/pairing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import {
ICore,
PairingTypes,
Expand Down Expand Up @@ -36,7 +36,6 @@ import {
} from "@walletconnect/jsonrpc-utils";
import { FIVE_MINUTES, THIRTY_DAYS } from "@walletconnect/time";
import EventEmitter from "events";
import { Logger } from "pino";
import {
PAIRING_CONTEXT,
PAIRING_STORAGE_VERSION,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/publisher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HEARTBEAT_EVENTS } from "@walletconnect/heartbeat";
import { RequestArguments } from "@walletconnect/jsonrpc-types";
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { RelayJsonRpc } from "@walletconnect/relay-api";
import { IPublisher, IRelayer, PublisherTypes, RelayerTypes } from "@walletconnect/types";
import {
Expand All @@ -10,7 +10,6 @@ import {
isUndefined,
} from "@walletconnect/utils";
import { EventEmitter } from "events";
import { Logger } from "pino";
import { PUBLISHER_CONTEXT, PUBLISHER_DEFAULT_TTL } from "../constants";

export class Publisher extends IPublisher {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/controllers/relayer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pino, { Logger } from "pino";
import { EventEmitter } from "events";
import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider";
import {
Expand All @@ -13,6 +12,8 @@ import {
generateChildLogger,
getDefaultLoggerOptions,
getLoggerContext,
Logger,
pino,
} from "@walletconnect/logger";
import { RelayJsonRpc } from "@walletconnect/relay-api";
import { toMiliseconds } from "@walletconnect/time";
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { ICore, IStore } from "@walletconnect/types";
import {
getInternalError,
isProposalStruct,
isSessionStruct,
isUndefined,
} from "@walletconnect/utils";
import { Logger } from "pino";
import { CORE_STORAGE_PREFIX, STORE_STORAGE_VERSION } from "../constants";
import isEqual from "lodash.isequal";

Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/controllers/subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Logger } from "pino";
import { EventEmitter } from "events";
import { HEARTBEAT_EVENTS } from "@walletconnect/heartbeat";
import { ErrorResponse, RequestArguments } from "@walletconnect/jsonrpc-types";
import { generateChildLogger, getLoggerContext } from "@walletconnect/logger";
import { generateChildLogger, getLoggerContext, Logger } from "@walletconnect/logger";
import { RelayJsonRpc } from "@walletconnect/relay-api";
import { Watch } from "@walletconnect/time";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/core.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pino from "pino";
import { EventEmitter } from "events";

import KeyValueStorage from "@walletconnect/keyvaluestorage";
Expand All @@ -7,6 +6,7 @@ import {
generateChildLogger,
getDefaultLoggerOptions,
getLoggerContext,
pino,
} from "@walletconnect/logger";
import { CoreTypes, ICore } from "@walletconnect/types";

Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/crypto.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, describe, it, beforeEach } from "vitest";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";
import * as utils from "@walletconnect/utils";
import pino from "pino";
import Sinon from "sinon";
import { Core, CORE_DEFAULT, Crypto } from "../src";
import { TEST_CORE_OPTIONS } from "./shared";
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/keychain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect, describe, it } from "vitest";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import pino from "pino";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";

import {
Core,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/messages.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, describe, it, beforeEach } from "vitest";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";
import { generateRandomBytes32, hashMessage } from "@walletconnect/utils";
import pino from "pino";

import {
Core,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/relayer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, describe, it, beforeEach, afterEach } from "vitest";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";
import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider";
import pino from "pino";

import {
Core,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect, describe, it, beforeEach } from "vitest";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import pino from "pino";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";
import { Core, CORE_STORAGE_PREFIX, Store, STORE_STORAGE_VERSION } from "../src";
import { TEST_CORE_OPTIONS } from "./shared";
import { ICore, IStore, SessionTypes } from "@walletconnect/types";
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/subscriber.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect, describe, it, beforeEach, afterAll, afterEach } from "vitest";
import pino from "pino";
import Sinon from "sinon";
import { getDefaultLoggerOptions } from "@walletconnect/logger";
import { getDefaultLoggerOptions, pino } from "@walletconnect/logger";
import { ICore, IRelayer, ISubscriber } from "@walletconnect/types";
import { generateRandomBytes32, getRelayProtocolName } from "@walletconnect/utils";

Expand Down
6 changes: 2 additions & 4 deletions packages/sign-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@
"@walletconnect/heartbeat": "1.0.0",
"@walletconnect/jsonrpc-provider": "1.0.5",
"@walletconnect/jsonrpc-utils": "1.0.3",
"@walletconnect/logger": "1.0.1",
"@walletconnect/logger": "2.0.0",
"@walletconnect/time": "1.0.1",
"@walletconnect/types": "2.1.1",
"@walletconnect/utils": "2.1.1",
"pino": "6.7.0",
"pino-pretty": "4.3.0"
"@walletconnect/utils": "2.1.1"
},
"devDependencies": {
"@walletconnect/jsonrpc-ws-connection": "1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/sign-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {
generateChildLogger,
getDefaultLoggerOptions,
getLoggerContext,
pino,
} from "@walletconnect/logger";
import { SignClientTypes, ISignClient, ISignClientEvents, EngineTypes } from "@walletconnect/types";
import { getAppMetadata } from "@walletconnect/utils";
import { EventEmitter } from "events";
import pino from "pino";
import { SIGN_CLIENT_DEFAULT, SIGN_CLIENT_PROTOCOL, SIGN_CLIENT_VERSION } from "./constants";
import { Engine, Proposal, Session } from "./controllers";

Expand Down
2 changes: 1 addition & 1 deletion packages/sign-client/src/controllers/proposal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from "pino";
import { Store } from "@walletconnect/core";
import { Logger } from "@walletconnect/logger";
import { ICore, ProposalTypes } from "@walletconnect/types";

import { SIGN_CLIENT_STORAGE_PREFIX, PROPOSAL_CONTEXT } from "../constants";
Expand Down
2 changes: 1 addition & 1 deletion packages/sign-client/src/controllers/session.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from "pino";
import { Store } from "@walletconnect/core";
import { Logger } from "@walletconnect/logger";
import { ICore, SessionTypes } from "@walletconnect/types";

import { SIGN_CLIENT_STORAGE_PREFIX, SESSION_CONTEXT } from "../constants";
Expand Down
3 changes: 2 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@walletconnect/events": "1.0.0",
"@walletconnect/heartbeat": "1.0.0",
"@walletconnect/jsonrpc-types": "1.0.1",
"@walletconnect/keyvaluestorage": "1.0.1-rc.2"
"@walletconnect/keyvaluestorage": "1.0.1-rc.2",
"@walletconnect/logger": "2.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/types/src/core/core.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import { IHeartBeat } from "@walletconnect/heartbeat";
import { IKeyValueStorage, KeyValueStorageOptions } from "@walletconnect/keyvaluestorage";
Expand All @@ -9,6 +8,7 @@ import { IKeyChain } from "./keychain";
import { IJsonRpcHistory } from "./history";
import { IExpirer } from "./expirer";
import { IPairing } from "./pairing";
import { Logger } from "@walletconnect/logger";

export declare namespace CoreTypes {
interface Options {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JsonRpcPayload } from "@walletconnect/jsonrpc-types";
import { Logger } from "pino";
import { Logger } from "@walletconnect/logger";
import { ICore } from "./core";
import { IKeyChain } from "./keychain";

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/expirer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import { Logger } from "@walletconnect/logger";

import { ICore } from "./core";

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/history.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import {
ErrorResponse,
JsonRpcRequest,
JsonRpcResponse,
RequestArguments,
} from "@walletconnect/jsonrpc-types";
import { Logger } from "@walletconnect/logger";

import { ICore } from "./core";

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/keychain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Logger } from "pino";
import { Logger } from "@walletconnect/logger";
import { ICore } from "./core";

export abstract class IKeyChain {
Expand Down
3 changes: 1 addition & 2 deletions packages/types/src/core/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Logger } from "pino";

import { Logger } from "@walletconnect/logger";
import { ICore } from "./core";

export type MessageRecord = Record<string, string>;
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/pairing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
JsonRpcResult,
JsonRpcError,
} from "@walletconnect/jsonrpc-types";
import { Logger } from "pino";
import EventEmitter from "events";

import { ICore, CoreTypes } from "./core";
import { IStore } from "./store";

import { RelayerTypes } from "../core/relayer";
import { Logger } from "@walletconnect/logger";

export declare namespace PairingTypes {
interface Struct {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/publisher.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import { Logger } from "@walletconnect/logger";

import { IRelayer, RelayerTypes } from "./relayer";

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/relayer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import { IJsonRpcProvider } from "@walletconnect/jsonrpc-types";
import { Logger } from "@walletconnect/logger";

import { ICore } from "./core";
import { IMessageTracker } from "./messages";
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorResponse } from "@walletconnect/jsonrpc-types";
import { Logger } from "pino";
import { Logger } from "@walletconnect/logger";
import { ICore } from "./core";

export abstract class IStore<Key, Value> {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/core/subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Logger } from "pino";
import { IEvents } from "@walletconnect/events";
import { ErrorResponse } from "@walletconnect/jsonrpc-types";
import { Logger } from "@walletconnect/logger";

import { IRelayer, RelayerTypes } from "./relayer";

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/sign-client/client.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import EventEmmiter from "events";
import { Logger } from "pino";
import { IEngine } from "./engine";
import { IProposal, ProposalTypes } from "./proposal";
import { ISession, SessionTypes } from "./session";
import { CoreTypes, ICore } from "../core/core";
import { Logger } from "@walletconnect/logger";

export declare namespace SignClientTypes {
type Event =
Expand Down
2 changes: 0 additions & 2 deletions providers/ethereum-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"eip1193-provider": "1.0.1",
"ethereum-test-network": "0.1.6",
"ethers": "5.6.9",
"pino": "6.7.0",
"pino-pretty": "4.3.0",
"uint8arrays": "3.1.0",
"web3": "1.7.5"
}
Expand Down
2 changes: 0 additions & 2 deletions providers/signer-connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
"@walletconnect/sign-client": "2.1.1",
"@walletconnect/types": "2.1.1",
"@walletconnect/utils": "2.1.1",
"pino": "6.7.0",
"pino-pretty": "4.3.0",
"uint8arrays": "3.1.0"
}
}
Loading

0 comments on commit 1170770

Please sign in to comment.