-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: User-defined logger config (#6409)
## Summary This PR adds a possibility to customize log level via the `level` property (limit to just see errors or show errors and warnings) and enable/disable strict mode (via `strict` property), which will be useful for changes implemented in [this](#6310) PR to show invalid `.value` access warnings only in the strict mode. ## Example recording https://github.com/user-attachments/assets/232d3b69-d99c-4114-989f-967d9d8c9e22 ## Test plan - Open `EmptyExample` (which will be reverted to the original implementation before merging this PR), - Change logger settings (e.g. the `level` property) via `Animated.configureLogger`, --------- Co-authored-by: Tomasz Żelawski <40713406+tjzel@users.noreply.github.com>
- Loading branch information
Showing
11 changed files
with
152 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
delete global.MessageChannel; | ||
require('./src/jestUtils').setUpTests(); | ||
|
||
global.__reanimatedLoggerConfig = { | ||
logFunction: (data) => { | ||
switch (data.level) { | ||
case 'warn': | ||
console.warn(data.message.content); | ||
break; | ||
case 'error': | ||
case 'fatal': | ||
case 'syntax': | ||
console.error(data.message.content); | ||
break; | ||
} | ||
}, | ||
level: 'warn', | ||
strict: false, | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters