From 7856d84034e9021bccc41fad38e2f528d843a179 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Fri, 5 May 2023 11:56:15 +0100 Subject: [PATCH] Fix use of logger that assumes it interpolates strings (#10789) --- src/components/structures/MatrixChat.tsx | 4 ++-- src/components/structures/RoomView.tsx | 6 +++--- src/components/views/auth/CaptchaForm.tsx | 2 +- src/editor/commands.tsx | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 8a7dbe4bde..4a58c66a35 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1504,7 +1504,7 @@ export default class MatrixChat extends React.PureComponent { if (state === SyncState.Syncing && prevState === SyncState.Syncing) { return; } - logger.info("MatrixClient sync state => %s", state); + logger.info(`MatrixClient sync state => ${state}`); if (state !== SyncState.Prepared) { return; } @@ -1863,7 +1863,7 @@ export default class MatrixChat extends React.PureComponent { subAction: params?.action, }); } else { - logger.info("Ignoring showScreen for '%s'", screen); + logger.info(`Ignoring showScreen for '${screen}'`); } } diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index dc748c807e..b121bdb5cc 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -842,7 +842,7 @@ export class RoomView extends React.Component { // making it impossible to indicate a newly joined room. if (!joining && roomId) { if (!room && shouldPeek) { - logger.info("Attempting to peek into room %s", roomId); + logger.info(`Attempting to peek into room ${roomId}`); this.setState({ peekLoading: true, isPeeking: true, // this will change to false if peeking fails @@ -1671,7 +1671,7 @@ export class RoomView extends React.Component { }); }, (error) => { - logger.error("Failed to reject invite: %s", error); + logger.error(`Failed to reject invite: ${error}`); const msg = error.message ? error.message : JSON.stringify(error); Modal.createDialog(ErrorDialog, { @@ -1705,7 +1705,7 @@ export class RoomView extends React.Component { rejecting: false, }); } catch (error) { - logger.error("Failed to reject invite: %s", error); + logger.error(`Failed to reject invite: ${error}`); const msg = error.message ? error.message : JSON.stringify(error); Modal.createDialog(ErrorDialog, { diff --git a/src/components/views/auth/CaptchaForm.tsx b/src/components/views/auth/CaptchaForm.tsx index a34038f000..ec67acb5d0 100644 --- a/src/components/views/auth/CaptchaForm.tsx +++ b/src/components/views/auth/CaptchaForm.tsx @@ -94,7 +94,7 @@ export default class CaptchaForm extends React.Component