diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 521150648a..4f10fde823 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -16,6 +16,7 @@ limitations under the License. import "matrix-react-sdk/src/@types/global"; // load matrix-react-sdk's type extensions first import type { Renderer } from "react-dom"; +import type { logger } from "matrix-js-sdk/src/logger"; type ElectronChannel = "app_onAction" | @@ -36,6 +37,7 @@ type ElectronChannel = declare global { interface Window { mxSendRageshake: (text: string, withLogs?: boolean) => void; + matrixLogger: typeof logger; matrixChat: ReturnType; // electron-only diff --git a/src/vector/app.tsx b/src/vector/app.tsx index 8cd86de046..732976388e 100644 --- a/src/vector/app.tsx +++ b/src/vector/app.tsx @@ -31,17 +31,18 @@ import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery"; import * as Lifecycle from "matrix-react-sdk/src/Lifecycle"; import type MatrixChatType from "matrix-react-sdk/src/components/structures/MatrixChat"; import SdkConfig from "matrix-react-sdk/src/SdkConfig"; +import { logger } from "matrix-js-sdk/src/logger"; import { parseQs, parseQsFromFragment } from './url_utils'; import VectorBasePlatform from "./platform/VectorBasePlatform"; import { createClient } from "matrix-js-sdk/src/matrix"; -import { logger } from "matrix-js-sdk/src/logger"; - let lastLocationHashSet: string = null; logger.log(`Application is running in ${process.env.NODE_ENV} mode`); +window.matrixLogger = logger; + // Parse the given window.location and return parameters that can be used when calling // MatrixChat.showScreen(screen, params) function getScreenFromLocation(location: Location) {