From e97f856e7e448bdf271826c7399aa05cbf361dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Mon, 28 Oct 2024 17:21:59 +0100 Subject: [PATCH] feat: Improve log interception - Support console.group and console.groupEnd - Log an message instead of throwing for console.count, console.countReset, console.table, console.time and console.timeEnd which are unsupported by cozy-minilog and/or react-native --- .../webviews/jsInteractions/jsLogInterception.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/webviews/jsInteractions/jsLogInterception.ts b/src/components/webviews/jsInteractions/jsLogInterception.ts index 58ca108d7..ebb2f5683 100644 --- a/src/components/webviews/jsInteractions/jsLogInterception.ts +++ b/src/components/webviews/jsInteractions/jsLogInterception.ts @@ -20,6 +20,13 @@ export const jsLogInterception = ` info: (...log) => consoleLog('info', log), warn: (...log) => consoleLog('log', ['warn:', ...log]), error: (...log) => consoleLog('error', log), + group: (...log) => consoleLog('group', log), + groupEnd: (...log) => consoleLog('groupEnd', log), + count: () => consoleLog('log', ['console.count is not supported in the flagship app']), + countReset: () => consoleLog('log', ['console.countReset is not supported in the flagship app']), + table: () => consoleLog('log', ['console.table is not supported in the flagship app']), + time: () => consoleLog('log', ['console.time is not supported in the flagship app']), + timeEnd: () => consoleLog('log', ['console.timeEnd is not supported in the flagship app']), } `