Skip to content

Commit d80f5f5

Browse files
committed
added system log to mcuLogObserver
1 parent e54c3e3 commit d80f5f5

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

nRF Toolbox.xcodeproj/project.pbxproj

+18-16
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@
270270
C39941C227352FC600E7AA33 /* ZephyrPacket.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39941C127352FC600E7AA33 /* ZephyrPacket.swift */; };
271271
C39941E6273BCE0500E7AA33 /* nRF_Toolbox_DebugTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C39941E5273BCE0500E7AA33 /* nRF_Toolbox_DebugTests.swift */; };
272272
C3CD27D526B097510026FE67 /* AEXML in Frameworks */ = {isa = PBXBuildFile; productRef = C3CD27D426B097510026FE67 /* AEXML */; };
273-
C3CD27DB26B097AB0026FE67 /* NordicDFU in Frameworks */ = {isa = PBXBuildFile; productRef = C3CD27DA26B097AB0026FE67 /* NordicDFU */; };
274273
C3CD27DE26B098070026FE67 /* Charts in Frameworks */ = {isa = PBXBuildFile; productRef = C3CD27DD26B098070026FE67 /* Charts */; };
275274
C3E8C1AC26F21FD0000A3737 /* FilterSwitchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3E8C1AB26F21FD0000A3737 /* FilterSwitchView.swift */; };
276275
C3E8C1AE26F21FE4000A3737 /* FilterSwitchView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3E8C1AD26F21FE3000A3737 /* FilterSwitchView.xib */; };
276+
C3EFCAF027A943EE00BFE8C4 /* NordicDFU in Frameworks */ = {isa = PBXBuildFile; productRef = C3EFCAEF27A943EE00BFE8C4 /* NordicDFU */; };
277277
CC7B90D148FC21C73B54BFAB /* NumberFormatter+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7B93FA695799F95D065492 /* NumberFormatter+Ext.swift */; };
278278
CC7B91DDFD7EF39F27FEC85A /* CommandImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7B95845343A3D826B220D5 /* CommandImage.swift */; };
279279
/* End PBXBuildFile section */
@@ -584,8 +584,8 @@
584584
isa = PBXFrameworksBuildPhase;
585585
buildActionMask = 2147483647;
586586
files = (
587+
C3EFCAF027A943EE00BFE8C4 /* NordicDFU in Frameworks */,
587588
522636371C60FFB00054A550 /* libz.tbd in Frameworks */,
588-
C3CD27DB26B097AB0026FE67 /* NordicDFU in Frameworks */,
589589
52BDCB191C3FD31F00E2680F /* Accelerate.framework in Frameworks */,
590590
52BDCBBE1C3FD86900E2680F /* QuartzCore.framework in Frameworks */,
591591
C3CD27D526B097510026FE67 /* AEXML in Frameworks */,
@@ -1782,10 +1782,10 @@
17821782
name = "nRF Toolbox";
17831783
packageProductDependencies = (
17841784
C3CD27D426B097510026FE67 /* AEXML */,
1785-
C3CD27DA26B097AB0026FE67 /* NordicDFU */,
17861785
C3CD27DD26B098070026FE67 /* Charts */,
17871786
C39941B5273402FA00E7AA33 /* McuManager */,
17881787
C39941BB27341AAE00E7AA33 /* ZIPFoundation */,
1788+
C3EFCAEF27A943EE00BFE8C4 /* NordicDFU */,
17891789
);
17901790
productName = "nRF Toolbox";
17911791
productReference = 5217F3E21859EE0000F2D5BB /* nRF Toolbox Debug.app */;
@@ -1805,6 +1805,8 @@
18051805
C39941E8273BCE0500E7AA33 /* PBXTargetDependency */,
18061806
);
18071807
name = "nRF Toolbox DebugTests";
1808+
packageProductDependencies = (
1809+
);
18081810
productName = "nRF Toolbox DebugTests";
18091811
productReference = C39941E3273BCE0500E7AA33 /* nRF Toolbox DebugTests.xctest */;
18101812
productType = "com.apple.product-type.bundle.unit-test";
@@ -1848,10 +1850,10 @@
18481850
mainGroup = 5217F3D91859EE0000F2D5BB;
18491851
packageReferences = (
18501852
C3CD27D326B097510026FE67 /* XCRemoteSwiftPackageReference "AEXML" */,
1851-
C3CD27D926B097AB0026FE67 /* XCRemoteSwiftPackageReference "IOS-Pods-DFU-Library" */,
18521853
C3CD27DC26B098070026FE67 /* XCRemoteSwiftPackageReference "Charts" */,
18531854
C39941B4273402FA00E7AA33 /* XCRemoteSwiftPackageReference "IOS-nRF-Connect-Device-Manager" */,
18541855
C39941BA27341AAE00E7AA33 /* XCRemoteSwiftPackageReference "ZIPFoundation" */,
1856+
C3EFCAEE27A943EE00BFE8C4 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */,
18551857
);
18561858
productRefGroup = 5217F3E31859EE0000F2D5BB /* Products */;
18571859
projectDirPath = "";
@@ -2664,20 +2666,20 @@
26642666
minimumVersion = 4.6.0;
26652667
};
26662668
};
2667-
C3CD27D926B097AB0026FE67 /* XCRemoteSwiftPackageReference "IOS-Pods-DFU-Library" */ = {
2669+
C3CD27DC26B098070026FE67 /* XCRemoteSwiftPackageReference "Charts" */ = {
26682670
isa = XCRemoteSwiftPackageReference;
2669-
repositoryURL = "https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library.git";
2671+
repositoryURL = "https://github.com/danielgindi/Charts.git";
26702672
requirement = {
26712673
kind = upToNextMajorVersion;
2672-
minimumVersion = 4.10.4;
2674+
minimumVersion = 4.0.1;
26732675
};
26742676
};
2675-
C3CD27DC26B098070026FE67 /* XCRemoteSwiftPackageReference "Charts" */ = {
2677+
C3EFCAEE27A943EE00BFE8C4 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */ = {
26762678
isa = XCRemoteSwiftPackageReference;
2677-
repositoryURL = "https://github.com/danielgindi/Charts.git";
2679+
repositoryURL = "https://github.com/NordicSemiconductor/IOS-DFU-Library.git";
26782680
requirement = {
2679-
kind = upToNextMajorVersion;
2680-
minimumVersion = 4.0.1;
2681+
branch = master;
2682+
kind = branch;
26812683
};
26822684
};
26832685
/* End XCRemoteSwiftPackageReference section */
@@ -2698,16 +2700,16 @@
26982700
package = C3CD27D326B097510026FE67 /* XCRemoteSwiftPackageReference "AEXML" */;
26992701
productName = AEXML;
27002702
};
2701-
C3CD27DA26B097AB0026FE67 /* NordicDFU */ = {
2702-
isa = XCSwiftPackageProductDependency;
2703-
package = C3CD27D926B097AB0026FE67 /* XCRemoteSwiftPackageReference "IOS-Pods-DFU-Library" */;
2704-
productName = NordicDFU;
2705-
};
27062703
C3CD27DD26B098070026FE67 /* Charts */ = {
27072704
isa = XCSwiftPackageProductDependency;
27082705
package = C3CD27DC26B098070026FE67 /* XCRemoteSwiftPackageReference "Charts" */;
27092706
productName = Charts;
27102707
};
2708+
C3EFCAEF27A943EE00BFE8C4 /* NordicDFU */ = {
2709+
isa = XCSwiftPackageProductDependency;
2710+
package = C3EFCAEE27A943EE00BFE8C4 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */;
2711+
productName = NordicDFU;
2712+
};
27112713
/* End XCSwiftPackageProductDependency section */
27122714
};
27132715
rootObject = 5217F3DA1859EE0000F2D5BB /* Project object */;

nRF Toolbox/Profiles/ZephyrDFU/ViewController/NotConnectedViewController/Util/McuMgrLogObserver.swift

+13-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,21 @@ class McuMgrLogObserver: LogObserver, McuMgrLogDelegate {
5050
var shouldLog: Bool = true
5151

5252
func log(_ msg: String, ofCategory category: McuMgrLogCategory, atLevel level: McuMgrLogLevel) {
53-
// guard shouldLog else { return }
53+
SystemLog(category: .update, type: toSystemLogLevel(level: level)).log(message: msg)
54+
5455
logWith(level.level, message: msg)
5556
}
5657

58+
private func toSystemLogLevel(level: McuMgrLogLevel) -> LogType {
59+
switch (level) {
60+
case .error: return .error
61+
case .application: return .application
62+
case .debug: return .debug
63+
case .info: return .info
64+
case .verbose: return .verbose
65+
case .warning: return .warning
66+
}
67+
}
68+
5769

5870
}

nRF Toolbox/Utilities/SystemLog.swift

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ extension LogCategory {
112112
static let ble = LogCategory(rawValue: "ble")!
113113
static let util = LogCategory(rawValue: "util")!
114114
static let app = LogCategory(rawValue: "application")!
115+
static let update = LogCategory(rawValue: "update")!
115116
}
116117

117118
struct SystemLog {

0 commit comments

Comments
 (0)