Replace console.log with logger.log

Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
Dariusz Niemczyk 2021-10-15 16:59:13 +02:00 committed by Dariusz Niemczyk
parent db01bfc0fd
commit dc9f77a509
6 changed files with 31 additions and 31 deletions

View file

@ -41,13 +41,13 @@ export const rageshakePromise = initRageshake();
export function preparePlatform() {
if (window.electron) {
console.log("Using Electron platform");
logger.log("Using Electron platform");
PlatformPeg.set(new ElectronPlatform());
} else if (window.matchMedia('(display-mode: standalone)').matches) {
console.log("Using PWA platform");
logger.log("Using PWA platform");
PlatformPeg.set(new PWAPlatform());
} else {
console.log("Using Web platform");
logger.log("Using Web platform");
PlatformPeg.set(new WebPlatform());
}
}
@ -84,9 +84,9 @@ export function loadOlm(): Promise<void> {
return Olm.init({
locateFile: () => olmWasmPath,
}).then(() => {
console.log("Using WebAssembly Olm");
logger.log("Using WebAssembly Olm");
}).catch((e) => {
console.log("Failed to load Olm: trying legacy version", e);
logger.log("Failed to load Olm: trying legacy version", e);
return new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = 'olm_legacy.js'; // XXX: This should be cache-busted too
@ -98,9 +98,9 @@ export function loadOlm(): Promise<void> {
// not 'Olm' which is still the failed wasm version.
return window.Olm.init();
}).then(() => {
console.log("Using legacy Olm");
logger.log("Using legacy Olm");
}).catch((e) => {
console.log("Both WebAssembly and asm.js Olm failed!", e);
logger.log("Both WebAssembly and asm.js Olm failed!", e);
});
});
}
@ -127,7 +127,7 @@ export async function loadLanguage() {
export async function loadSkin() {
// Ensure the skin is the very first thing to load for the react-sdk. We don't even want to reference
// the SDK until we have to in imports.
console.log("Loading skin...");
logger.log("Loading skin...");
// load these async so that its code is not executed immediately and we can catch any exceptions
const [sdk, skin] = await Promise.all([
import(
@ -142,7 +142,7 @@ export async function loadSkin() {
"../component-index"),
]);
sdk.loadSkin(skin);
console.log("Skin loaded!");
logger.log("Skin loaded!");
}
export async function loadTheme() {