Skip to content

Commit

Permalink
feat: Improve log interception
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
zatteo committed Oct 28, 2024
1 parent e2cede8 commit e97f856
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/webviews/jsInteractions/jsLogInterception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
}
`

Expand Down

0 comments on commit e97f856

Please sign in to comment.