Skip to content

Commit 4898b4f

Browse files
authored
Merge pull request #2 from HDB-Li/1.1.8
1.2.0
2 parents 96e77ae + 8b71255 commit 4898b4f

File tree

296 files changed

+3651
-2583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+3651
-2583
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [1.2.0](https://github.com/HDB-Li/LLDebugToolSwift/releases/tag/1.2.0) (09/22/2018)
2+
3+
### Synchronous update
4+
5+
More update informations please see [LLDebugTool CHANGELOG](https://github.com/HDB-Li/LLDebugTool/blob/master/CHANGELOG.md).
6+
7+
Update for version 1.2.0 based on LLDebugTool. Nothing changed in swift.
8+
19
## [1.1.7](https://github.com/HDB-Li/LLDebugToolSwift/releases/tag/1.1.7) (09/14/2018)
210

311
### Synchronous update

LLDebugToolSwift.podspec

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "LLDebugToolSwift"
3-
s.version = "1.1.7"
3+
s.version = "1.2.0"
44
s.summary = "LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations."
55
s.homepage = "https://github.com/HDB-Li/LLDebugToolSwift"
66
s.license = "MIT"
@@ -9,8 +9,42 @@ Pod::Spec.new do |s|
99
s.platform = :ios, "8.0"
1010
s.source = { :git => "https://github.com/HDB-Li/LLDebugToolSwift.git", :tag => s.version }
1111
s.requires_arc = true
12-
s.source_files = "LLDebugToolSwift/**/*.{h,m,swift}"
13-
# s.resources = "LLDebugToolSwift/**/*.{xib,storyboard,bundle}"
14-
s.dependency "LLDebugTool" , '1.1.7'
12+
s.source_files = "LLDebugToolSwift/**/*.{h,m,swift}"
13+
# s.resources = "LLDebugToolSwift/**/*.{xib,storyboard,bundle}"
14+
s.dependency "LLDebugTool" , '1.2.0'
1515
s.swift_version = "4.0"
16+
17+
s.subspec 'Network' do |ss|
18+
ss.dependency "LLDebugTool/Network" , '1.2.0'
19+
end
20+
21+
s.subspec 'Log' do |ss|
22+
ss.source_files = "LLDebugToolSwift/**/*.{h,m,swift}"
23+
ss.dependency "LLDebugTool/Log" , '1.2.0'
24+
end
25+
26+
s.subspec 'Crash' do |ss|
27+
ss.dependency "LLDebugTool/Crash" , '1.2.0'
28+
end
29+
30+
s.subspec 'AppInfo' do |ss|
31+
ss.dependency "LLDebugTool/AppInfo" , '1.2.0'
32+
end
33+
34+
s.subspec 'Sandbox' do |ss|
35+
ss.dependency "LLDebugTool/Sandbox" , '1.2.0'
36+
end
37+
38+
s.subspec 'Screenshot' do |ss|
39+
ss.dependency "LLDebugTool/Screenshot" , '1.2.0'
40+
end
41+
42+
s.subspec 'StorageManager' do |ss|
43+
ss.dependency "LLDebugTool/StorageManager" , '1.2.0'
44+
end
45+
46+
s.subspec 'General' do |ss|
47+
ss.dependency "LLDebugTool/General" , '1.2.0'
48+
end
49+
1650
end

LLDebugToolSwift/LLog.swift

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,63 +22,58 @@
2222
// SOFTWARE.
2323

2424
import UIKit
25+
26+
#if DEBUG
2527
import LLDebugTool
28+
#endif
2629

2730
public class LLog: NSObject {
2831

2932
/// Log a normal message.
3033
public static func log(message : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
31-
#if DEBUG
32-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.default, onEvent: nil, message: message)
33-
#endif
34+
self.log(message: message, event: nil)
3435
}
3536

3637
/// Log a normal message with event.
3738
public static func log(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
3839
#if DEBUG
39-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.default, onEvent: event, message: message)
40+
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .default, onEvent: event, message: message)
4041
#endif
4142
}
4243

4344
/// Log a alert message.
4445
public static func alertLog(message : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
45-
#if DEBUG
46-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.alert, onEvent: nil, message: message)
47-
#endif
46+
self.alertLog(message: message, event: nil)
4847
}
4948

5049
/// Log a alert message with event.
5150
public static func alertLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
5251
#if DEBUG
53-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.alert, onEvent: event, message: message)
52+
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .alert, onEvent: event, message: message)
5453
#endif
5554
}
5655

5756
/// Log a warning message.
5857
public static func warningLog(message : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
59-
#if DEBUG
60-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.warning, onEvent: nil, message: message)
61-
#endif
58+
self.warningLog(message: message, event: nil)
6259
}
6360

6461
/// Log a warning message with event.
6562
public static func warningLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
6663
#if DEBUG
67-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.warning, onEvent: event, message: message)
64+
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .warning, onEvent: event, message: message)
6865
#endif
6966
}
7067

7168
/// Log a error message.
7269
public static func errorLog(message : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
73-
#if DEBUG
74-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.error, onEvent: nil, message: message)
75-
#endif
70+
self.errorLog(message: message, event: nil)
7671
}
7772

7873
/// Log a error message with event.
7974
public static func errorLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
8075
#if DEBUG
81-
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: LLConfigLogLevel.error, onEvent: event, message: message)
76+
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .error, onEvent: event, message: message)
8277
#endif
8378
}
8479

LLDebugToolSwiftDemo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@
245245
364A05AC214917E70056719F /* Sources */,
246246
364A05AD214917E70056719F /* Frameworks */,
247247
364A05AE214917E70056719F /* Resources */,
248-
C21809CAB80DD894785C9043 /* [CP] Embed Pods Frameworks */,
249248
);
250249
buildRules = (
251250
);
@@ -265,7 +264,6 @@
265264
364A05B7214917E70056719F /* Sources */,
266265
364A05B8214917E70056719F /* Frameworks */,
267266
364A05B9214917E70056719F /* Resources */,
268-
B53BBD97B8607A179A22FD7A /* [CP] Embed Pods Frameworks */,
269267
);
270268
buildRules = (
271269
);
@@ -379,46 +377,6 @@
379377
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LLDebugToolSwiftDemo/Pods-LLDebugToolSwiftDemo-frameworks.sh\"\n";
380378
showEnvVarsInLog = 0;
381379
};
382-
B53BBD97B8607A179A22FD7A /* [CP] Embed Pods Frameworks */ = {
383-
isa = PBXShellScriptBuildPhase;
384-
buildActionMask = 2147483647;
385-
files = (
386-
);
387-
inputPaths = (
388-
"${SRCROOT}/Pods/Target Support Files/Pods-LLDebugToolSwiftDemoUITests/Pods-LLDebugToolSwiftDemoUITests-frameworks.sh",
389-
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
390-
"${BUILT_PRODUCTS_DIR}/LLDebugTool/LLDebugTool.framework",
391-
);
392-
name = "[CP] Embed Pods Frameworks";
393-
outputPaths = (
394-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
395-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LLDebugTool.framework",
396-
);
397-
runOnlyForDeploymentPostprocessing = 0;
398-
shellPath = /bin/sh;
399-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LLDebugToolSwiftDemoUITests/Pods-LLDebugToolSwiftDemoUITests-frameworks.sh\"\n";
400-
showEnvVarsInLog = 0;
401-
};
402-
C21809CAB80DD894785C9043 /* [CP] Embed Pods Frameworks */ = {
403-
isa = PBXShellScriptBuildPhase;
404-
buildActionMask = 2147483647;
405-
files = (
406-
);
407-
inputPaths = (
408-
"${SRCROOT}/Pods/Target Support Files/Pods-LLDebugToolSwiftDemoTests/Pods-LLDebugToolSwiftDemoTests-frameworks.sh",
409-
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
410-
"${BUILT_PRODUCTS_DIR}/LLDebugTool/LLDebugTool.framework",
411-
);
412-
name = "[CP] Embed Pods Frameworks";
413-
outputPaths = (
414-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
415-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LLDebugTool.framework",
416-
);
417-
runOnlyForDeploymentPostprocessing = 0;
418-
shellPath = /bin/sh;
419-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LLDebugToolSwiftDemoTests/Pods-LLDebugToolSwiftDemoTests-frameworks.sh\"\n";
420-
showEnvVarsInLog = 0;
421-
};
422380
C34B62C56B97F233FD5E9F7B /* [CP] Check Pods Manifest.lock */ = {
423381
isa = PBXShellScriptBuildPhase;
424382
buildActionMask = 2147483647;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "crash-1.jpg",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
92.1 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "crash-2.jpg",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
57.2 KB
Loading

LLDebugToolSwiftDemo/DemoViewControllers/TestCrashViewController.swift

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,53 @@ class TestCrashViewController: BaseTestViewController {
1515
self.title = NSLocalizedString("test.crash", comment: "")
1616
}
1717

18+
private func initNoteView() {
19+
let header = UIView()
20+
let label = UILabel()
21+
label.font = UIFont.systemFont(ofSize: 14)
22+
label.numberOfLines = 0
23+
label.textAlignment = .center
24+
label.lineBreakMode = .byCharWrapping
25+
label.text = NSLocalizedString("crash.tip", comment: "")
26+
let size = label.sizeThatFits(CGSize(width: UIScreen.main.bounds.size.width - 20, height: CGFloat.greatestFiniteMagnitude))
27+
label.frame = CGRect(x: 10, y: 10, width: size.width, height: size.height)
28+
header.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: size.height + 20)
29+
header.addSubview(label)
30+
31+
let footer = UIView()
32+
//1570 × 1050
33+
let imageViewWidth = UIScreen.main.bounds.size.width - 20
34+
let imageViewHeight = imageViewWidth * 1050.0 / 1570.0
35+
let tipHeight : CGFloat = 30
36+
let imageView1 = UIImageView()
37+
imageView1.image = UIImage(named: "crash-1.jpg")
38+
imageView1.frame = CGRect(x: 10, y: 10, width: imageViewWidth, height: imageViewHeight)
39+
footer.addSubview(imageView1)
40+
41+
let tip1 = UILabel()
42+
tip1.textAlignment = .center
43+
tip1.font = UIFont.systemFont(ofSize: 14)
44+
tip1.text = "Tip 1"
45+
tip1.frame = CGRect(x: 0, y: 10 + imageViewHeight, width: UIScreen.main.bounds.size.width, height: tipHeight)
46+
footer.addSubview(tip1)
47+
48+
let imageView2 = UIImageView()
49+
imageView2.image = UIImage(named: "crash-2.jpg")
50+
imageView2.frame = CGRect(x: 10, y: 10 + imageViewHeight + tipHeight + 10, width: imageViewWidth, height: imageViewHeight)
51+
footer.addSubview(imageView2)
52+
53+
let tip2 = UILabel()
54+
tip2.textAlignment = .center
55+
tip2.font = UIFont.systemFont(ofSize: 14)
56+
tip2.text = "Tip 2"
57+
tip2.frame = CGRect(x: 0, y: 10 + imageViewHeight + tipHeight + 10 + imageViewHeight, width: UIScreen.main.bounds.size.width, height: tipHeight)
58+
footer.addSubview(tip2)
59+
footer.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 10 + imageViewHeight + tipHeight + 10 + imageViewHeight + tipHeight + 10)
60+
61+
self.tableView.tableHeaderView = header;
62+
self.tableView.tableFooterView = footer;
63+
}
64+
1865
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
1966
return 3
2067
}
@@ -52,13 +99,15 @@ class TestCrashViewController: BaseTestViewController {
5299
func testArrayOutRangeCrash() {
53100
UserDefaults.standard.set(true, forKey: "openCrash")
54101
UserDefaults.standard.synchronize()
102+
sleep(1)
55103
let array = ["a" , "b"]
56104
_ = array[3]
57105
}
58106

59107
func testPointErrorCrash() {
60108
UserDefaults.standard.set(true, forKey: "openCrash")
61109
UserDefaults.standard.synchronize()
110+
sleep(1)
62111
let a : NSObject = "dssdf" as NSObject
63112
_ = (a as! NSArray).firstObject
64113
}

LLDebugToolSwiftDemo/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.7</string>
20+
<string>1.2.0</string>
2121
<key>CFBundleVersion</key>
2222
<string>1</string>
2323
<key>LSRequiresIPhoneOS</key>

0 commit comments

Comments
 (0)