From 77ed38cf916e1cd78ddbb5214b3cb09b7e57eca1 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 3 Apr 2024 09:41:39 -0400 Subject: [PATCH] Remove debug logging --- packages/driver/package.json | 4 +--- packages/driver/src/conUtils.ts | 6 ------ packages/driver/test/connection.test.ts | 16 +++------------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/packages/driver/package.json b/packages/driver/package.json index 75097ed3b..bb86e3a71 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -48,7 +48,5 @@ "watch": "nodemon -e js,ts,tsx --ignore dist -x ", "dev": "yarn tsc --project tsconfig.json --incremental && yarn build:deno" }, - "dependencies": { - "debug": "^4.3.4" - } + "dependencies": {} } diff --git a/packages/driver/src/conUtils.ts b/packages/driver/src/conUtils.ts index ec98263ee..5803f90bd 100644 --- a/packages/driver/src/conUtils.ts +++ b/packages/driver/src/conUtils.ts @@ -30,10 +30,6 @@ import { InterfaceError } from "./errors"; import { decodeB64, utf8Decoder, utf8Encoder } from "./primitives/buffer"; import { crcHqx } from "./primitives/crcHqx"; -import Debug from "debug"; - -const debug = Debug("edgedb:con_utils"); - const DOMAIN_NAME_MAX_LEN = 63; export type Address = [string, number]; @@ -193,8 +189,6 @@ export class ResolvedConnectConfig { source: string, validator?: (value: NonNullable) => this[`_${Param}`] ): boolean { - const log = debug.extend("_setParam"); - log("setting %s to %o from %s", param, value, source); if (this[`_${param}`] === null) { this[`_${param}Source`] = source; if (value !== null) { diff --git a/packages/driver/test/connection.test.ts b/packages/driver/test/connection.test.ts index fe4a60fb6..705094acc 100644 --- a/packages/driver/test/connection.test.ts +++ b/packages/driver/test/connection.test.ts @@ -15,7 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import debug from "debug"; let mockFs = false; let mockedFiles: { [key: string]: string } = {}; @@ -76,7 +75,7 @@ jest.mock("os", () => { import * as fs from "fs"; import * as crypto from "crypto"; import { join as pathJoin } from "path"; -import { Client, Duration } from "../src/index.node"; +import { type Client, Duration } from "../src/index.node"; import { parseDuration } from "../src/conUtils"; import { parseConnectArguments, findStashPath } from "../src/conUtils.server"; import { getClient } from "./testbase"; @@ -233,16 +232,8 @@ type ConnectionTestCase = { warnings?: string[]; } & ({ result: ConnectionResult } | { error: { type: string } }); -async function runConnectionTest( - testcase: ConnectionTestCase, - shouldDebug = false -): Promise { +async function runConnectionTest(testcase: ConnectionTestCase): Promise { const { env = {}, opts: _opts = {}, fs } = testcase; - if (shouldDebug) { - debug.enable("edgedb:con_utils:*"); - } else { - debug.disable(); - } const opts = { ..._opts, instanceName: _opts.instance }; @@ -335,7 +326,6 @@ describe("parseConnectArguments", () => { for (const [i, testcase] of connectionTestcases.entries()) { const { fs, platform } = testcase; - const knownFailure = [221, 222, 228, 229, 242, 244, 245, 258].includes(i); if ( fs && ((!platform && @@ -348,7 +338,7 @@ describe("parseConnectArguments", () => { }); } else { test(`shared client test: index={${i}}`, async () => { - await runConnectionTest(testcase, knownFailure); + await runConnectionTest(testcase); }); } }