Replace console.info with logger.info

Related https://github.com/vector-im/element-web/issues/18425
pull/21833/head
Dariusz Niemczyk 2021-10-15 16:32:15 +02:00 committed by Dariusz Niemczyk
parent 5290afcc4c
commit 2c66403b3c
11 changed files with 21 additions and 21 deletions

View File

@ -825,7 +825,7 @@ export default class CallHandler extends EventEmitter {
});
return;
} else if (members.length === 2) {
console.info(`Place ${payload.type} call in ${payload.room_id}`);
logger.info(`Place ${payload.type} call in ${payload.room_id}`);
this.placeCall(payload.room_id, payload.type, payload.transferee);
} else { // > 2
@ -838,17 +838,17 @@ export default class CallHandler extends EventEmitter {
}
break;
case 'place_conference_call':
console.info("Place conference call in " + payload.room_id);
logger.info("Place conference call in " + payload.room_id);
Analytics.trackEvent('voip', 'placeConferenceCall');
CountlyAnalytics.instance.trackStartCall(payload.room_id, payload.type === PlaceCallType.Video, true);
this.startCallApp(payload.room_id, payload.type);
break;
case 'end_conference':
console.info("Terminating conference call in " + payload.room_id);
logger.info("Terminating conference call in " + payload.room_id);
this.terminateCallApp(payload.room_id);
break;
case 'hangup_conference':
console.info("Leaving conference call in "+ payload.room_id);
logger.info("Leaving conference call in "+ payload.room_id);
this.hangupCallApp(payload.room_id);
break;
case 'incoming_call':

View File

@ -101,7 +101,7 @@ class Presence {
try {
await MatrixClientPeg.get().setPresence({ presence: this.state });
console.info("Presence:", newState);
logger.info("Presence:", newState);
} catch (err) {
logger.error("Failed to set presence:", err);
this.state = oldState;

View File

@ -1452,7 +1452,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
if (state === "SYNCING" && prevState === "SYNCING") {
return;
}
console.info("MatrixClient sync state => %s", state);
logger.info("MatrixClient sync state => %s", state);
if (state !== "PREPARED") { return; }
this.firstSyncComplete = true;
@ -1818,7 +1818,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
group_id: groupId,
});
} else {
console.info("Ignoring showScreen for '%s'", screen);
logger.info("Ignoring showScreen for '%s'", screen);
}
}

View File

@ -498,7 +498,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
// making it impossible to indicate a newly joined room.
if (!joining && roomId) {
if (!room && shouldPeek) {
console.info("Attempting to peek into room %s", roomId);
logger.info("Attempting to peek into room %s", roomId);
this.setState({
peekLoading: true,
isPeeking: true, // this will change to false if peeking fails

View File

@ -97,7 +97,7 @@ export default class CaptchaForm extends React.Component<ICaptchaFormProps, ICap
+ "authentication");
}
console.info("Rendering to %s", divId);
logger.info("Rendering to %s", divId);
this.captchaWidgetId = global.grecaptcha.render(divId, {
sitekey: publicKey,
callback: this.props.onCaptchaResponse,

View File

@ -162,7 +162,7 @@ const WidgetContextMenu: React.FC<IProps> = ({
let revokeButton;
if (!userWidget && !isLocalWidget && isAllowedWidget) {
const onRevokeClick = () => {
console.info("Revoking permission for widget to load: " + app.eventId);
logger.info("Revoking permission for widget to load: " + app.eventId);
const current = SettingsStore.getValue("allowedWidgets", roomId);
current[app.eventId] = false;
const level = SettingsStore.firstSupportedLevel("allowedWidgets");

View File

@ -314,7 +314,7 @@ export default class AppTile extends React.Component<IProps, IState> {
private grantWidgetPermission = (): void => {
const roomId = this.props.room.roomId;
console.info("Granting permission for widget to load: " + this.props.app.eventId);
logger.info("Granting permission for widget to load: " + this.props.app.eventId);
const current = SettingsStore.getValue("allowedWidgets", roomId);
current[this.props.app.eventId] = true;
const level = SettingsStore.firstSupportedLevel("allowedWidgets");

View File

@ -658,7 +658,7 @@ const RedactMessagesButton: React.FC<IBaseProps> = ({ member }) => {
// so first yield to allow to rerender after closing the dialog.
await Promise.resolve();
console.info(`Started redacting recent ${count} messages for ${user} in ${roomId}`);
logger.info(`Started redacting recent ${count} messages for ${user} in ${roomId}`);
await Promise.all(eventsToRedact.map(async event => {
try {
await cli.redactEvent(roomId, event.getId());
@ -668,7 +668,7 @@ const RedactMessagesButton: React.FC<IBaseProps> = ({ member }) => {
logger.error(err);
}
}));
console.info(`Finished redacting recent ${count} messages for ${user} in ${roomId}`);
logger.info(`Finished redacting recent ${count} messages for ${user} in ${roomId}`);
}
};

View File

@ -432,7 +432,7 @@ export default class HTMLExporter extends Exporter {
const exportEnd = performance.now();
if (this.cancelled) {
console.info("Export cancelled successfully");
logger.info("Export cancelled successfully");
} else {
this.updateProgress("Export successful!");
this.updateProgress(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);

View File

@ -89,8 +89,8 @@ export default class JSONExporter extends Exporter {
}
public async export() {
console.info("Starting export process...");
console.info("Fetching events...");
logger.info("Starting export process...");
logger.info("Fetching events...");
const fetchStart = performance.now();
const res = await this.getRequiredEvents();
@ -98,7 +98,7 @@ export default class JSONExporter extends Exporter {
logger.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
console.info("Creating output...");
logger.info("Creating output...");
const text = await this.createOutput(res);
if (this.files.length) {
@ -112,9 +112,9 @@ export default class JSONExporter extends Exporter {
const exportEnd = performance.now();
if (this.cancelled) {
console.info("Export cancelled successfully");
logger.info("Export cancelled successfully");
} else {
console.info("Export successful!");
logger.info("Export successful!");
logger.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
}

View File

@ -141,9 +141,9 @@ export default class PlainTextExporter extends Exporter {
const exportEnd = performance.now();
if (this.cancelled) {
console.info("Export cancelled successfully");
logger.info("Export cancelled successfully");
} else {
console.info("Export successful!");
logger.info("Export successful!");
logger.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
}