Replace console.warn with logger.warn

Related https://github.com/vector-im/element-web/issues/18425
pull/19442/head
Dariusz Niemczyk 2021-10-15 17:00:43 +02:00 committed by Dariusz Niemczyk
parent dc9f77a509
commit 85a81af1da
4 changed files with 11 additions and 11 deletions

View File

@ -222,7 +222,7 @@ async function verifyServerConfig() {
if (hsUrl) {
logger.log("Config uses a default_hs_url - constructing a default_server_config using this information");
console.warn(
logger.warn(
"DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use " +
"default_server_config instead.",
);
@ -247,7 +247,7 @@ async function verifyServerConfig() {
if (serverName) {
logger.log("Config uses a default_server_name - doing .well-known lookup");
console.warn(
logger.warn(
"DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please " +
"use default_server_config instead.",
);
@ -259,7 +259,7 @@ async function verifyServerConfig() {
const { hsUrl, isUrl, userId } = await Lifecycle.getStoredSessionVars();
if (hsUrl && userId) {
logger.error(e);
console.warn("A session was found - suppressing config error and using the session's homeserver");
logger.warn("A session was found - suppressing config error and using the session's homeserver");
logger.log("Using pre-existing hsUrl and isUrl: ", { hsUrl, isUrl });
validatedConfig = await AutoDiscoveryUtils.validateServerConfigWithStaticUrls(hsUrl, isUrl, true);

View File

@ -56,7 +56,7 @@ export function setupLogStorage() {
if (SdkConfig.get().bug_report_endpoint_url) {
return initRageshakeStore();
}
console.warn("No bug report endpoint set - logs will not be persisted");
logger.warn("No bug report endpoint set - logs will not be persisted");
return Promise.resolve();
}

View File

@ -96,7 +96,7 @@ let meetApi: any; // JitsiMeetExternalAPI
]);
widgetApi.start();
} else {
console.warn("No parent URL or no widget ID - assuming no widget API is available");
logger.warn("No parent URL or no widget ID - assuming no widget API is available");
}
// Populate the Jitsi params now
@ -208,7 +208,7 @@ function joinConference() { // event handler bound in HTML
if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) {
if (!openIdToken?.access_token) { // eslint-disable-line camelcase
// We've failing to get a token, don't try to init conference
console.warn('Expected to have an OpenID credential, cannot initialize widget.');
logger.warn('Expected to have an OpenID credential, cannot initialize widget.');
document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget";
return;
}
@ -223,7 +223,7 @@ function joinConference() { // event handler bound in HTML
widgetApi.setAlwaysOnScreen(true);
}
console.warn(
logger.warn(
"[Jitsi Widget] The next few errors about failing to parse URL parameters are fine if " +
"they mention 'external_api' or 'jitsi' in the stack. They're just Jitsi Meet trying to parse " +
"our fragment values and not recognizing the options.",

View File

@ -126,12 +126,12 @@ class SeshatIndexManager extends BaseEventIndexManager {
private onIpcReply = (ev: {}, payload: IPCPayload) => {
if (payload.id === undefined) {
console.warn("Ignoring IPC reply with no ID");
logger.warn("Ignoring IPC reply with no ID");
return;
}
if (this.pendingIpcCalls[payload.id] === undefined) {
console.warn("Unknown IPC payload ID: " + payload.id);
logger.warn("Unknown IPC payload ID: " + payload.id);
return;
}
@ -505,12 +505,12 @@ export default class ElectronPlatform extends VectorBasePlatform {
private onIpcReply = (ev, payload) => {
if (payload.id === undefined) {
console.warn("Ignoring IPC reply with no ID");
logger.warn("Ignoring IPC reply with no ID");
return;
}
if (this.pendingIpcCalls[payload.id] === undefined) {
console.warn("Unknown IPC payload ID: " + payload.id);
logger.warn("Unknown IPC payload ID: " + payload.id);
return;
}