Replace console.error with logger.error

Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
Dariusz Niemczyk 2021-10-15 16:30:53 +02:00 committed by Dariusz Niemczyk
parent 9c594a8a96
commit 5e73a212f4
124 changed files with 417 additions and 250 deletions

View file

@ -45,6 +45,8 @@ import { createSpaceFromCommunity } from "../../utils/space";
import { Action } from "../../dispatcher/actions";
import { RightPanelPhases } from "../../stores/RightPanelStorePhases";
import { logger } from "matrix-js-sdk/src/logger";
const LONG_DESC_PLACEHOLDER = _td(
`<h1>HTML for your community's page</h1>
<p>
@ -186,7 +188,7 @@ class FeaturedRoom extends React.Component {
this.props.groupId,
this.props.summaryInfo.room_id,
).catch((err) => {
console.error('Error whilst removing room from group summary', err);
logger.error('Error whilst removing room from group summary', err);
const roomName = this.props.summaryInfo.name ||
this.props.summaryInfo.canonical_alias ||
this.props.summaryInfo.room_id;
@ -352,7 +354,7 @@ class FeaturedUser extends React.Component {
this.props.groupId,
this.props.summaryInfo.user_id,
).catch((err) => {
console.error('Error whilst removing user from group summary', err);
logger.error('Error whilst removing user from group summary', err);
const displayName = this.props.summaryInfo.displayname || this.props.summaryInfo.user_id;
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createTrackedDialog(
@ -551,7 +553,7 @@ export default class GroupView extends React.Component {
},
});
}).catch((e) => {
console.error('Error getting group inviter profile', e);
logger.error('Error getting group inviter profile', e);
}).finally(() => {
if (this._unmounted) return;
this.setState({
@ -641,7 +643,7 @@ export default class GroupView extends React.Component {
}).catch((e) => {
this.setState({ uploadingAvatar: false });
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to upload avatar image", e);
logger.error("Failed to upload avatar image", e);
Modal.createTrackedDialog('Failed to upload image', '', ErrorDialog, {
title: _t('Error'),
description: _t('Failed to upload image'),
@ -675,7 +677,7 @@ export default class GroupView extends React.Component {
saving: false,
});
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
console.error("Failed to save community profile", e);
logger.error("Failed to save community profile", e);
Modal.createTrackedDialog('Failed to update group', '', ErrorDialog, {
title: _t('Error'),
description: _t('Failed to update community'),
@ -1421,7 +1423,7 @@ export default class GroupView extends React.Component {
);
}
} else {
console.error("Invalid state for GroupView");
logger.error("Invalid state for GroupView");
return <div />;
}
}