File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ const _warningMap: Map<string, WarningInfo> = new Map();
5757
5858if ( __DEV__ ) {
5959 const { error, warn} = console ;
60+
6061 ( console : any ) . error = function ( ) {
6162 error . apply ( console , arguments ) ;
6263 // Show yellow box for the `warning` module.
@@ -65,8 +66,15 @@ if (__DEV__) {
6566 updateWarningMap . apply ( null , arguments ) ;
6667 }
6768 } ;
69+
6870 ( console : any ) . warn = function ( ) {
6971 warn . apply ( console , arguments ) ;
72+
73+ if ( typeof arguments [ 0 ] === 'string' &&
74+ arguments [ 0 ] . startsWith ( '(ADVICE)' ) ) {
75+ return ;
76+ }
77+
7078 updateWarningMap . apply ( null , arguments ) ;
7179 } ;
7280
Original file line number Diff line number Diff line change 3131#define RCTLog (...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)
3232#define RCTLogTrace (...) _RCTLog(RCTLogLevelTrace, __VA_ARGS__)
3333#define RCTLogInfo (...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__)
34+ #define RCTLogAdvice (string, ...) RCTLogWarn([@" (ADVICE) " stringByAppendingString: (NSString *)string], __VA_ARGS__)
3435#define RCTLogWarn (...) _RCTLog(RCTLogLevelWarning, __VA_ARGS__)
3536#define RCTLogError (...) _RCTLog(RCTLogLevelError, __VA_ARGS__)
3637
Original file line number Diff line number Diff line change @@ -575,10 +575,10 @@ static void RCTUpdateShadowPathForView(RCTView *view)
575575 // Can't accurately calculate box shadow, so fall back to pixel-based shadow
576576 view.layer .shadowPath = nil ;
577577
578- RCTLogWarn (@" View #%@ of type %@ has a shadow set but cannot calculate "
579- " shadow efficiently. Consider setting a background color to "
580- " fix this, or apply the shadow to a more specific component." ,
581- view.reactTag , [view class ]);
578+ RCTLogAdvice (@" View #%@ of type %@ has a shadow set but cannot calculate "
579+ " shadow efficiently. Consider setting a background color to "
580+ " fix this, or apply the shadow to a more specific component." ,
581+ view.reactTag , [view class ]);
582582 }
583583 }
584584}
You can’t perform that action at this time.
0 commit comments