[NO QA] fix: collecting logs on dev - #36659
Conversation
|
cc @techievivek |
| // eslint-disable-next-line no-console | ||
| console.log = (...args) => { | ||
| logMessage(args); | ||
| if (shouldStoreLogs && CONFIG.ENVIRONMENT !== CONST.ENVIRONMENT.DEV) { |
There was a problem hiding this comment.
Coming from the slack thread https://expensify.slack.com/archives/C01GTK53T8Q/p1708081810577189?thread_ts=1703982689.203629&cid=C01GTK53T8Q
ah, we can’t entirely skip adding a log to onyx here, because this override is needed when e.g. console.log is used in the callback function of the executed arbitrary code. I opened this PR and added an environment check, tested it and works fine.
That means this piece of code won't work?
console.log = (...args) => {
originalConsoleLog.apply(console, args);
};
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.4.43-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.43-20 🚀
|
Details
This is the follow up PR to #36337
When working on the app locally and using
console.login the app, logs are stored in Onyx no matter if Client side logging is on or off. This might cause problems for developers, like crashing the app, when they log a large output.Fixed Issues
$ #34082
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
n/aAndroid: mWeb Chrome
n/a
iOS: Native
n/a
iOS: mWeb Safari
n/a
MacOS: Chrome / Safari
n/a
MacOS: Desktop
n/a