Limit log spam from FrameBasedAnimationDriver (#44782)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44782

## Changelog:

[Android] [Fixed] - Reduce maximum log spam from FrameBasedAnimationDriver

Reviewed By: ahmed-shehata

Differential Revision: D58135399

fbshipit-source-id: 355524b9b96bb1fc9de73fddb6486b1c377da077
This commit is contained in:
Giulio Jiang
2024-06-05 05:31:33 -07:00
committed by Facebook GitHub Bot
parent a1e8118541
commit 42299499d8
@@ -30,6 +30,7 @@ class FrameBasedAnimationDriver extends AnimationDriver {
private double mFromValue;
private int mIterations;
private int mCurrentLoop;
private int logCount = 0;
FrameBasedAnimationDriver(ReadableMap config) {
resetConfig(config);
@@ -81,7 +82,10 @@ class FrameBasedAnimationDriver extends AnimationDriver {
if (ReactBuildConfig.DEBUG) {
throw new IllegalStateException(message);
} else {
FLog.w(ReactConstants.TAG, message);
if (logCount < 100) {
FLog.w(ReactConstants.TAG, message);
logCount++;
}
return;
}
} else if (mHasFinished) {