Skip to content

Commit

Permalink
Improve logging in startup
Browse files Browse the repository at this point in the history
... to help figure out what is taking so long.
  • Loading branch information
richvdh committed Dec 29, 2023
1 parent b948090 commit 3310a11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa

// importing rust-crypto will download the webassembly, so we delay it until we know it will be
// needed.
this.logger.debug("Downloading Rust crypto library");
const RustCrypto = await import("./rust-crypto");

const rustCrypto = await RustCrypto.initRustCrypto({
Expand Down
5 changes: 3 additions & 2 deletions src/rust-crypto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export async function initRustCrypto(args: {
const { logger } = args;

// initialise the rust matrix-sdk-crypto-wasm, if it hasn't already been done
logger.debug("Initialising Rust crypto-sdk WASM artifact");
await RustSdkCryptoJs.initAsync();

// enable tracing in the rust-sdk
Expand All @@ -83,7 +84,7 @@ export async function initRustCrypto(args: {
args.storePassphrase,
);

logger.info("Completed rust crypto-sdk setup");
logger.debug("Completed rust crypto-sdk setup");
return rustCrypto;
}

Expand All @@ -97,7 +98,7 @@ async function initOlmMachine(
storePrefix: string | null,
storePassphrase: string | undefined,
): Promise<RustCrypto> {
logger.info("Init OlmMachine");
logger.debug("Init OlmMachine");
const olmMachine = await RustSdkCryptoJs.OlmMachine.initialize(
new RustSdkCryptoJs.UserId(userId),
new RustSdkCryptoJs.DeviceId(deviceId),
Expand Down

0 comments on commit 3310a11

Please sign in to comment.