You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/11/22 08:10:20 UTC

[GitHub] cxfeng1 closed pull request #1767: [iOS] Also write js error log to monitor.

cxfeng1 closed pull request #1767: [iOS] Also write js error log to monitor.
URL: https://github.com/apache/incubator-weex/pull/1767
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 6d42333e75..811ed62163 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -1142,15 +1142,15 @@ + (void)handleConsoleOutputWithArgument:(NSArray *)arguments logLevel:(WXLogFlag
         [string appendFormat:@"%@ ", jsVal];
         if (idx == arguments.count - 1) {
             if (logLevel) {
-                if (WXLogFlagWarning == logLevel) {
+                if (WXLogFlagWarning == logLevel || WXLogFlagError == logLevel) {
                     id<WXAppMonitorProtocol> appMonitorHandler = [WXSDKEngine handlerForProtocol:@protocol(WXAppMonitorProtocol)];
                     if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
-                        [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"jswarning" success:FALSE errorCode:@"99999" errorMsg:string arg:[WXSDKEngine topInstance].pageName];
+                        [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"jswarning" success:NO errorCode:@"99999" errorMsg:string arg:[WXSDKEngine topInstance].pageName];
                     }
                 }
                 WX_LOG(logLevel, @"%@", string);
             } else {
-                [string appendFormat:@"%@ ", jsVal]                                  ;
+                [string appendFormat:@"%@ ", jsVal];
                 WXLogInfo(@"%@", string);
             }
         }
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
index a332abf76d..78d4b4d607 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
@@ -167,16 +167,16 @@ static void consoleWithArguments(NSArray *arguments, WXLogFlag logLevel)
         [arguments enumerateObjectsUsingBlock:^(NSString *jsVal, NSUInteger idx, BOOL *stop) {
             if (idx == arguments.count - 1) {
                 if (logLevel) {
-                    if (WXLogFlagWarning == logLevel) {
+                    if (WXLogFlagWarning == logLevel || WXLogFlagError == logLevel) {
                         id<WXAppMonitorProtocol> appMonitorHandler = [WXSDKEngine handlerForProtocol:@protocol(WXAppMonitorProtocol)];
                         if ([appMonitorHandler respondsToSelector:@selector(commitAppMonitorAlarm:monitorPoint:success:errorCode:errorMsg:arg:)]) {
-                            [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"jswarning" success:FALSE errorCode:@"99999" errorMsg:jsLog arg:[WXSDKEngine topInstance].pageName];
+                            [appMonitorHandler commitAppMonitorAlarm:@"weex" monitorPoint:@"jswarning" success:NO errorCode:@"99999" errorMsg:jsLog arg:[WXSDKEngine topInstance].pageName];
                         }
                     }
                     WX_LOG(logLevel, @"%@", jsLog);
                 }
                 else {
-                    [jsLog appendFormat:@"%@ ", jsVal]                                  ;
+                    [jsLog appendFormat:@"%@ ", jsVal];
                     WXLogInfo(@"%@", jsLog);
                 }
             }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services