Skip to content

Commit

Permalink
异常信息打印优化
Browse files Browse the repository at this point in the history
  • Loading branch information
simplezhli committed Aug 26, 2020
1 parent e6b5f9a commit ca19f82
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 49 deletions.
87 changes: 46 additions & 41 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
objects = {

/* Begin PBXBuildFile section */
2D537CF8CB7B61CC6D3527F9 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 38907E1482E1004F8671A409 /* libPods-Runner.a */; };
7273ADF72478DB7A00309008 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 7273ADF02478DB7900309008 /* GeneratedPluginRegistrant.m */; };
7273ADFB2478DB7A00309008 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7273ADF52478DB7A00309008 /* AppDelegate.swift */; };
7273ADFD2478E1F700309008 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7273ADEF2478DB7900309008 /* Assets.xcassets */; };
7273ADFF2478E21800309008 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
7273AE092478E42B00309008 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7273AE072478E42B00309008 /* LaunchScreen.storyboard */; };
7273AE0A2478E42B00309008 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7273AE082478E42B00309008 /* Main.storyboard */; };
AF66A34CF69A0AD65A8B89D8 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BECCE2088C05C4D8D9015FA0 /* libPods-Runner.a */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -30,9 +30,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0D5787F000D701006220B08C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
318934AD4DA85D2A6C6002C1 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
38907E1482E1004F8671A409 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
7273ADEE2478DB7900309008 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
7273ADEF2478DB7900309008 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -46,29 +43,41 @@
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
B465563105DEE7BC61D7A6B3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
B6743A8C17CF03C8D634C032 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
BD533B04B45BA6CDE9679991 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
BECCE2088C05C4D8D9015FA0 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C5A3AE6BED88396E1F97AF4E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2D537CF8CB7B61CC6D3527F9 /* libPods-Runner.a in Frameworks */,
AF66A34CF69A0AD65A8B89D8 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
5DE6C5996ACC5A0F382E36C0 /* Pods */ = {
5519C26671DDA0374F26E61C /* Frameworks */ = {
isa = PBXGroup;
children = (
0D5787F000D701006220B08C /* Pods-Runner.debug.xcconfig */,
B465563105DEE7BC61D7A6B3 /* Pods-Runner.release.xcconfig */,
318934AD4DA85D2A6C6002C1 /* Pods-Runner.profile.xcconfig */,
BECCE2088C05C4D8D9015FA0 /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
9707CA0EB99412E1173056F5 /* Pods */ = {
isa = PBXGroup;
children = (
B6743A8C17CF03C8D634C032 /* Pods-Runner.debug.xcconfig */,
C5A3AE6BED88396E1F97AF4E /* Pods-Runner.release.xcconfig */,
BD533B04B45BA6CDE9679991 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
Expand All @@ -88,8 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
5DE6C5996ACC5A0F382E36C0 /* Pods */,
9C86ED73F38E8236AB68EDDE /* Frameworks */,
9707CA0EB99412E1173056F5 /* Pods */,
5519C26671DDA0374F26E61C /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -116,30 +125,22 @@
path = Runner;
sourceTree = "<group>";
};
9C86ED73F38E8236AB68EDDE /* Frameworks */ = {
isa = PBXGroup;
children = (
38907E1482E1004F8671A409 /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
17701E06AD5370BA119620A8 /* [CP] Check Pods Manifest.lock */,
4614B24191EBC1B6AD98CEF6 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
59CB11677AEFD55CE30B4866 /* [CP] Embed Pods Frameworks */,
93293C537DB1A3B75BED48B9 /* [CP] Copy Pods Resources */,
57BAE4E2B439200DFEEBD55E /* [CP] Embed Pods Frameworks */,
1FC9CD116D60A071D396D7EB /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -198,22 +199,22 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
17701E06AD5370BA119620A8 /* [CP] Check Pods Manifest.lock */ = {
1FC9CD116D60A071D396D7EB /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
"${PODS_ROOT}/AMap2DMap/MAMapKit.framework/AMap.bundle",
);
name = "[CP] Check Pods Manifest.lock";
name = "[CP] Copy Pods Resources";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
Expand All @@ -230,40 +231,44 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
};
59CB11677AEFD55CE30B4866 /* [CP] Embed Pods Frameworks */ = {
4614B24191EBC1B6AD98CEF6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
93293C537DB1A3B75BED48B9 /* [CP] Copy Pods Resources */ = {
57BAE4E2B439200DFEEBD55E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
"${PODS_ROOT}/AMap2DMap/MAMapKit.framework/AMap.bundle",
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
Expand Down
2 changes: 1 addition & 1 deletion lib/net/intercept.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class AdapterInterceptor extends Interceptor{
response.statusCode = ExceptionHandle.success;
}
} catch (e) {
Log.d('异常信息:$e');
// Log.d('异常信息:$e');
// 解析异常直接按照返回原数据处理(一般为返回500,503 HTML页面代码)
result = sprintf(_kFailureFormat, [response.statusCode, '服务器异常(${response.statusCode})']);
}
Expand Down
18 changes: 11 additions & 7 deletions lib/util/log_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ class Log {

static void json(String msg, {String tag = tag}) {
if (!Constant.inProduction) {
final dynamic data = convert.json.decode(msg);
if (data is Map) {
_printMap(data);
} else if (data is List) {
_printList(data);
} else
LogUtil.v(msg, tag: tag);
try {
final dynamic data = convert.json.decode(msg);
if (data is Map) {
_printMap(data);
} else if (data is List) {
_printList(data);
} else
LogUtil.v(msg, tag: tag);
} catch(e) {
LogUtil.e(msg, tag: tag);
}
}
}

Expand Down

0 comments on commit ca19f82

Please sign in to comment.