Logs sideloading-related events with OSLog

This commit is contained in:
Riley Testut
2023-10-18 14:06:10 -05:00
committed by Magesh K
parent 6adf55b4b6
commit 93b6da4855
13 changed files with 161 additions and 22 deletions

View File

@@ -205,7 +205,11 @@ final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertificate, A
{
guard !self.isFinished else { return }
print("Finished authenticating with result:", result.error?.localizedDescription ?? "success")
switch result
{
case .failure(let error): Logger.sideload.error("Failed to authenticate account. \(error.localizedDescription, privacy: .public)")
case .success((let team, _, _)): Logger.sideload.notice("Authenticated account for team \(team.identifier, privacy: .public).")
}
let context = DatabaseManager.shared.persistentContainer.newBackgroundContext()
context.perform {
@@ -348,6 +352,8 @@ private extension AuthenticationOperation
if let appleID = Keychain.shared.appleIDEmailAddress, let password = Keychain.shared.appleIDPassword
{
Logger.sideload.notice("Authenticating Apple ID...")
self.authenticate(appleID: appleID, password: password) { (result) in
switch result
{