Globally replace all console.logs via codemod (#6827)

This commit replaces all the `console.log` to `logger.log` via an automated script.
Related: vector-im/element-web#18425
This commit is contained in:
Dariusz Niemczyk
2021-09-21 17:48:09 +02:00
committed by GitHub
parent 3a548d4c9c
commit 2d1d42b90e
81 changed files with 396 additions and 258 deletions
@@ -27,6 +27,8 @@ import { mediaFromMxc } from "../../../customisations/Media";
import AccessibleButton from '../elements/AccessibleButton';
import AvatarSetting from './AvatarSetting';
import { logger } from "matrix-js-sdk/src/logger";
interface IState {
userId?: string;
originalDisplayName?: string;
@@ -104,7 +106,7 @@ export default class ProfileSettings extends React.Component<{}, IState> {
}
if (this.state.avatarFile) {
console.log(
logger.log(
`Uploading new avatar, ${this.state.avatarFile.name} of type ${this.state.avatarFile.type},` +
` (${this.state.avatarFile.size}) bytes`);
const uri = await client.uploadContent(this.state.avatarFile);
@@ -116,7 +118,7 @@ export default class ProfileSettings extends React.Component<{}, IState> {
await client.setAvatarUrl(""); // use empty string as Synapse 500s on undefined
}
} catch (err) {
console.log("Failed to save profile", err);
logger.log("Failed to save profile", err);
Modal.createTrackedDialog('Failed to save profile', '', ErrorDialog, {
title: _t("Failed to save your profile"),
description: ((err && err.message) ? err.message : _t("The operation could not be completed")),