Skip to content

Commit c2688c5

Browse files
committed
refactor: remove logging fwk
Signed-off-by: 82Flex <82flex@gmail.com>
1 parent 7b539a4 commit c2688c5

File tree

9 files changed

+29
-89
lines changed

9 files changed

+29
-89
lines changed

TrollFools.xcodeproj/project.pbxproj

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
CCF470692C4A4919008D8197 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CCF4706B2C4A4919008D8197 /* Localizable.strings */; };
4343
CCF4706E2C4A4BAB008D8197 /* AppListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF4706D2C4A4BAB008D8197 /* AppListView.swift */; };
4444
CCF470732C4A4E81008D8197 /* TrollFoolsStub.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF470722C4A4E81008D8197 /* TrollFoolsStub.m */; };
45-
CCF5A09C2C4D40830097D48D /* CocoaLumberjack in Frameworks */ = {isa = PBXBuildFile; productRef = CCF5A09B2C4D40830097D48D /* CocoaLumberjack */; };
46-
CCF5A09E2C4D40830097D48D /* CocoaLumberjackSwift in Frameworks */ = {isa = PBXBuildFile; productRef = CCF5A09D2C4D40830097D48D /* CocoaLumberjackSwift */; };
47-
CCF5A0A02C4D40830097D48D /* CocoaLumberjackSwiftLogBackend in Frameworks */ = {isa = PBXBuildFile; productRef = CCF5A09F2C4D40830097D48D /* CocoaLumberjackSwiftLogBackend */; };
48-
CCF5A0A22C4D417F0097D48D /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF5A0A12C4D417F0097D48D /* main.swift */; };
4945
CCF5A0A42C4D45160097D48D /* AuxiliaryExecute.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF5A0A32C4D45160097D48D /* AuxiliaryExecute.swift */; };
5046
CCF5A0A62C4D45400097D48D /* AuxiliaryExecute+Spawn.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCF5A0A52C4D45400097D48D /* AuxiliaryExecute+Spawn.swift */; };
5147
CCF925442C4CE47800880D48 /* chown in Resources */ = {isa = PBXBuildFile; fileRef = CCF925432C4CE47800880D48 /* chown */; };
@@ -90,7 +86,6 @@
9086
CCF4706D2C4A4BAB008D8197 /* AppListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppListView.swift; sourceTree = "<group>"; };
9187
CCF470712C4A4E81008D8197 /* TrollFools-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TrollFools-Bridging-Header.h"; sourceTree = "<group>"; };
9288
CCF470722C4A4E81008D8197 /* TrollFoolsStub.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TrollFoolsStub.m; sourceTree = "<group>"; };
93-
CCF5A0A12C4D417F0097D48D /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
9489
CCF5A0A32C4D45160097D48D /* AuxiliaryExecute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuxiliaryExecute.swift; sourceTree = "<group>"; };
9590
CCF5A0A52C4D45400097D48D /* AuxiliaryExecute+Spawn.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AuxiliaryExecute+Spawn.swift"; sourceTree = "<group>"; };
9691
CCF925412C4C1B6F00880D48 /* LSApplicationWorkspace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LSApplicationWorkspace.h; sourceTree = "<group>"; };
@@ -106,10 +101,7 @@
106101
files = (
107102
CCB6A1172C4A540F000D75B0 /* CoreServices.framework in Frameworks */,
108103
CC1548FE2C4AADBB00A4173E /* MachOKitC in Frameworks */,
109-
CCF5A09E2C4D40830097D48D /* CocoaLumberjackSwift in Frameworks */,
110-
CCF5A0A02C4D40830097D48D /* CocoaLumberjackSwiftLogBackend in Frameworks */,
111104
CC1548FC2C4AADBB00A4173E /* MachOKit in Frameworks */,
112-
CCF5A09C2C4D40830097D48D /* CocoaLumberjack in Frameworks */,
113105
CC1548C92C4A6B2100A4173E /* ZIPFoundation in Frameworks */,
114106
);
115107
runOnlyForDeploymentPostprocessing = 0;
@@ -176,7 +168,6 @@
176168
isa = PBXGroup;
177169
children = (
178170
CC60FBE92CC4E6C400A6D21A /* Info.plist */,
179-
CCF5A0A12C4D417F0097D48D /* main.swift */,
180171
CCF470592C4A4649008D8197 /* TrollFoolsApp.swift */,
181172
CCF4706D2C4A4BAB008D8197 /* AppListView.swift */,
182173
CCB6A1182C4A58C7000D75B0 /* OptionView.swift */,
@@ -218,9 +209,6 @@
218209
CC1548C82C4A6B2100A4173E /* ZIPFoundation */,
219210
CC1548FB2C4AADBB00A4173E /* MachOKit */,
220211
CC1548FD2C4AADBB00A4173E /* MachOKitC */,
221-
CCF5A09B2C4D40830097D48D /* CocoaLumberjack */,
222-
CCF5A09D2C4D40830097D48D /* CocoaLumberjackSwift */,
223-
CCF5A09F2C4D40830097D48D /* CocoaLumberjackSwiftLogBackend */,
224212
);
225213
productName = TrollFools;
226214
productReference = CCF470562C4A4649008D8197 /* TrollFools.app */;
@@ -255,7 +243,6 @@
255243
packageReferences = (
256244
CC1548C72C4A6B2100A4173E /* XCRemoteSwiftPackageReference "ZIPFoundation" */,
257245
CC1548FA2C4AADBB00A4173E /* XCRemoteSwiftPackageReference "MachOKit" */,
258-
CCF5A09A2C4D40830097D48D /* XCRemoteSwiftPackageReference "CocoaLumberjack" */,
259246
);
260247
productRefGroup = CCF470572C4A4649008D8197 /* Products */;
261248
projectDirPath = "";
@@ -313,7 +300,6 @@
313300
CC19E4BB2C561D7300E0F1B5 /* SettingsView.swift in Sources */,
314301
CC1548D72C4A768700A4173E /* Injector.swift in Sources */,
315302
CCB6A1192C4A58C7000D75B0 /* OptionView.swift in Sources */,
316-
CCF5A0A22C4D417F0097D48D /* main.swift in Sources */,
317303
CCF4706E2C4A4BAB008D8197 /* AppListView.swift in Sources */,
318304
CC1548D32C4A743200A4173E /* SuccessView.swift in Sources */,
319305
CC1548D52C4A744300A4173E /* FailureView.swift in Sources */,
@@ -585,14 +571,6 @@
585571
minimumVersion = 0.19.0;
586572
};
587573
};
588-
CCF5A09A2C4D40830097D48D /* XCRemoteSwiftPackageReference "CocoaLumberjack" */ = {
589-
isa = XCRemoteSwiftPackageReference;
590-
repositoryURL = "https://github.com/CocoaLumberjack/CocoaLumberjack.git";
591-
requirement = {
592-
kind = upToNextMajorVersion;
593-
minimumVersion = 3.8.5;
594-
};
595-
};
596574
/* End XCRemoteSwiftPackageReference section */
597575

598576
/* Begin XCSwiftPackageProductDependency section */
@@ -611,21 +589,6 @@
611589
package = CC1548FA2C4AADBB00A4173E /* XCRemoteSwiftPackageReference "MachOKit" */;
612590
productName = MachOKitC;
613591
};
614-
CCF5A09B2C4D40830097D48D /* CocoaLumberjack */ = {
615-
isa = XCSwiftPackageProductDependency;
616-
package = CCF5A09A2C4D40830097D48D /* XCRemoteSwiftPackageReference "CocoaLumberjack" */;
617-
productName = CocoaLumberjack;
618-
};
619-
CCF5A09D2C4D40830097D48D /* CocoaLumberjackSwift */ = {
620-
isa = XCSwiftPackageProductDependency;
621-
package = CCF5A09A2C4D40830097D48D /* XCRemoteSwiftPackageReference "CocoaLumberjack" */;
622-
productName = CocoaLumberjackSwift;
623-
};
624-
CCF5A09F2C4D40830097D48D /* CocoaLumberjackSwiftLogBackend */ = {
625-
isa = XCSwiftPackageProductDependency;
626-
package = CCF5A09A2C4D40830097D48D /* XCRemoteSwiftPackageReference "CocoaLumberjack" */;
627-
productName = CocoaLumberjackSwiftLogBackend;
628-
};
629592
/* End XCSwiftPackageProductDependency section */
630593
};
631594
rootObject = CCF4704E2C4A4649008D8197 /* Project object */;

TrollFools.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TrollFools/AppListView.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Lessica on 2024/7/19.
66
//
77

8-
import CocoaLumberjackSwift
98
import Combine
109
import SwiftUI
1110

@@ -284,7 +283,7 @@ struct AppListCell: View {
284283
app.reload()
285284
vm.isRebuildNeeded = true
286285
}
287-
} catch { DDLogError("\(error.localizedDescription)") }
286+
} catch { NSLog("\(error.localizedDescription)") }
288287
} label: {
289288
Label(NSLocalizedString("Unlock Version", comment: ""), systemImage: "lock.open")
290289
}
@@ -297,7 +296,7 @@ struct AppListCell: View {
297296
app.reload()
298297
vm.isRebuildNeeded = true
299298
}
300-
} catch { DDLogError("\(error.localizedDescription)") }
299+
} catch { NSLog("\(error.localizedDescription)") }
301300
} label: {
302301
Label(NSLocalizedString("Lock Version", comment: ""), systemImage: "lock")
303302
}
@@ -630,7 +629,7 @@ struct AppListView: View {
630629
}
631630
}
632631
} catch {
633-
DDLogError("\(error.localizedDescription)")
632+
NSLog("\(error.localizedDescription)")
634633

635634
DispatchQueue.main.async {
636635
errorMessage = error.localizedDescription

TrollFools/AuxiliaryExecute+Spawn.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Lakr Aream on 2021/12/6.
66
//
77

8-
import CocoaLumberjackSwift
98
import Foundation
109

1110
@discardableResult
@@ -259,7 +258,7 @@ public extension AuxiliaryExecute {
259258
defer { for case let arg? in argv { free(arg) } }
260259

261260
// MARK: NOW POSIX_SPAWN -
262-
DDLogInfo("Execute \(command) \(args.joined(separator: " "))")
261+
NSLog("Execute \(command) \(args.joined(separator: " "))")
263262

264263
var pid: pid_t = 0
265264
let spawnStatus = posix_spawn(&pid, command, &fileActions, &attrs, argv + [nil], realEnv + [nil])
@@ -366,16 +365,16 @@ public extension AuxiliaryExecute {
366365
let terminationReason: TerminationReason
367366
if WIFSIGNALED(status) {
368367
let signal = WTERMSIG(status)
369-
DDLogError("Process \(pid) terminated with uncaught signal \(signal)")
368+
NSLog("Process \(pid) terminated with uncaught signal \(signal)")
370369
terminationReason = .uncaughtSignal(signal)
371370
} else {
372371
assert(WIFEXITED(status))
373372

374373
let exitCode = WEXITSTATUS(status)
375374
if exitCode == 0 {
376-
DDLogInfo("Process \(pid) exited successfully")
375+
NSLog("Process \(pid) exited successfully")
377376
} else {
378-
DDLogError("Process \(pid) exited with code \(exitCode)")
377+
NSLog("Process \(pid) exited with code \(exitCode)")
379378
}
380379

381380
terminationReason = .exit(exitCode)

TrollFools/EjectListView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Lessica on 2024/7/20.
66
//
77

8-
import CocoaLumberjackSwift
98
import Combine
109
import SwiftUI
1110

@@ -257,7 +256,7 @@ struct EjectListView: View {
257256
vm.app.reload()
258257
vm.reload()
259258
} catch {
260-
DDLogError("\(error)")
259+
NSLog("\(error)")
261260

262261
errorMessage = error.localizedDescription
263262
isErrorOccurred = true
@@ -298,7 +297,7 @@ struct EjectListView: View {
298297
isDeletingAll = false
299298
}
300299

301-
DDLogError("\(error)")
300+
NSLog("\(error)")
302301

303302
errorMessage = error.localizedDescription
304303
isErrorOccurred = true

TrollFools/Execute.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Lessica on 2024/7/19.
66
//
77

8-
import CocoaLumberjackSwift
98
import Foundation
109

1110
enum Execute {
@@ -23,10 +22,10 @@ enum Execute {
2322
personaOptions: .init(uid: 0, gid: 0)
2423
)
2524
if !receipt.stdout.isEmpty {
26-
DDLogInfo("Standard output: \(receipt.stdout)")
25+
NSLog("Standard output: \(receipt.stdout)")
2726
}
2827
if !receipt.stderr.isEmpty {
29-
DDLogInfo("Standard error: \(receipt.stderr)")
28+
NSLog("Standard error: \(receipt.stderr)")
3029
}
3130
return receipt.terminationReason
3231
}
@@ -43,10 +42,10 @@ enum Execute {
4342
personaOptions: .init(uid: 0, gid: 0)
4443
)
4544
if !receipt.stdout.isEmpty {
46-
DDLogInfo("Standard output: \(receipt.stdout)")
45+
NSLog("Standard output: \(receipt.stdout)")
4746
}
4847
if !receipt.stderr.isEmpty {
49-
DDLogInfo("Standard error: \(receipt.stderr)")
48+
NSLog("Standard error: \(receipt.stderr)")
5049
}
5150
return receipt
5251
}

TrollFools/InjectView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Created by Lessica on 2024/7/19.
66
//
77

8-
import CocoaLumberjackSwift
98
import SwiftUI
109

1110
private final class VCHookViewController: UIViewController {
@@ -67,7 +66,7 @@ struct InjectView: View {
6766
try injector.inject(urlList)
6867
return .success(())
6968
} catch {
70-
DDLogError("\(error)")
69+
NSLog("\(error)")
7170
return .failure(NSError(domain: kTrollFoolsErrorDomain, code: 0, userInfo: [
7271
NSLocalizedDescriptionKey: error.localizedDescription,
7372
]))

0 commit comments

Comments
 (0)