Replace console.warn with logger.warn

Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
Dariusz Niemczyk 2021-10-15 16:31:29 +02:00 committed by Dariusz Niemczyk
parent 5e73a212f4
commit 5290afcc4c
71 changed files with 195 additions and 127 deletions

View file

@ -176,7 +176,7 @@ export default class AppTile extends React.Component<IProps, IState> {
const u = url.parse(this.props.app.url);
const childContentProtocol = u.protocol;
if (parentContentProtocol === 'https:' && childContentProtocol !== 'https:') {
console.warn("Refusing to load mixed-content app:",
logger.warn("Refusing to load mixed-content app:",
parentContentProtocol, childContentProtocol, window.location, this.props.app.url);
return true;
}
@ -305,7 +305,7 @@ export default class AppTile extends React.Component<IProps, IState> {
dis.dispatch({ action: 'post_sticker_message', data: payload.data });
dis.dispatch({ action: 'stickerpicker_close' });
} else {
console.warn('Ignoring sticker message. Invalid capability');
logger.warn('Ignoring sticker message. Invalid capability');
}
break;
}

View file

@ -22,6 +22,8 @@ import dis from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions";
import { UserTab } from "../dialogs/UserSettingsDialog";
import { logger } from "matrix-js-sdk/src/logger";
export enum WarningKind {
Files,
Search,
@ -83,7 +85,7 @@ export default function DesktopBuildsNotice({ isRoomEncrypted, kind }: IProps) {
// for safety
if (!text) {
console.warn("Unknown desktop builds warning kind: ", kind);
logger.warn("Unknown desktop builds warning kind: ", kind);
return null;
}

View file

@ -20,6 +20,8 @@ import ICanvasEffect from '../../../effects/ICanvasEffect';
import { CHAT_EFFECTS } from '../../../effects';
import UIStore, { UI_EVENTS } from "../../../stores/UIStore";
import { logger } from "matrix-js-sdk/src/logger";
interface IProps {
roomWidth: number;
}
@ -38,7 +40,7 @@ const EffectsOverlay: FunctionComponent<IProps> = ({ roomWidth }) => {
effect = new Effect(options);
effectsRef.current[name] = effect;
} catch (err) {
console.warn(`Unable to load effect module at '../../../effects/${name}.`, err);
logger.warn(`Unable to load effect module at '../../../effects/${name}.`, err);
}
}
return effect;

View file

@ -33,6 +33,8 @@ import SettingsStore from "../../../settings/SettingsStore";
import { mediaFromMxc } from "../../../customisations/Media";
import { replaceableComponent } from "../../../utils/replaceableComponent";
import { logger } from "matrix-js-sdk/src/logger";
// A class for a child of GroupFilterPanel (possibly wrapped in a DNDTagTile) that represents
// a thing to click on for the user to filter the visible rooms in the RoomList to:
// - Rooms that are part of the group
@ -85,7 +87,7 @@ export default class TagTile extends React.Component {
if (this.unmounted) return;
this.setState({ profile });
}).catch((err) => {
console.warn('Could not fetch group profile for ' + this.props.tag, err);
logger.warn('Could not fetch group profile for ' + this.props.tag, err);
});
};