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

@ -162,7 +162,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
} else if (activeRoomId) {
const activeRoom = this.matrixClient.getRoom(activeRoomId);
if (!activeRoom) {
console.warn(`${activeRoomId} is current in RVS but missing from client - clearing sticky room`);
logger.warn(`${activeRoomId} is current in RVS but missing from client - clearing sticky room`);
this.algorithm.setStickyRoom(null);
} else if (activeRoom !== this.algorithm.stickyRoom) {
this.algorithm.setStickyRoom(activeRoom);
@ -226,7 +226,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
if (readReceiptChangeIsFor(payload.event, this.matrixClient)) {
const room = payload.room;
if (!room) {
console.warn(`Own read receipt was in unknown room ${room.roomId}`);
logger.warn(`Own read receipt was in unknown room ${room.roomId}`);
return;
}
await this.handleRoomUpdate(room, RoomUpdateCause.ReadReceipt);
@ -258,8 +258,8 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
this.updateFn.trigger();
};
if (!room) {
console.warn(`Live timeline event ${eventPayload.event.getId()} received without associated room`);
console.warn(`Queuing failed room update for retry as a result.`);
logger.warn(`Live timeline event ${eventPayload.event.getId()} received without associated room`);
logger.warn(`Queuing failed room update for retry as a result.`);
setTimeout(async () => {
const updatedRoom = this.matrixClient.getRoom(roomId);
await tryUpdate(updatedRoom);
@ -276,7 +276,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
}
const room = this.matrixClient.getRoom(roomId);
if (!room) {
console.warn(`Event ${eventPayload.event.getId()} was decrypted in an unknown room ${roomId}`);
logger.warn(`Event ${eventPayload.event.getId()} was decrypted in an unknown room ${roomId}`);
return;
}
await this.handleRoomUpdate(room, RoomUpdateCause.Timeline);
@ -289,7 +289,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
for (const roomId of roomIds) {
const room = this.matrixClient.getRoom(roomId);
if (!room) {
console.warn(`${roomId} was found in DMs but the room is not in the store`);
logger.warn(`${roomId} was found in DMs but the room is not in the store`);
continue;
}
@ -550,7 +550,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
* be used if the calling code will manually trigger the update.
*/
public regenerateAllLists({ trigger = true }) {
console.warn("Regenerating all room lists");
logger.warn("Regenerating all room lists");
const rooms = this.getPlausibleRooms();