Replaces Logger.debug() usage with Logger.notice()
Debug logs aren’t exported from release builds, so we now use `notice` level instead.
This commit is contained in:
parent
9c31b8a864
commit
e6cd5475e9
@ -119,7 +119,7 @@ private extension RepairDatabaseViewController
|
|||||||
let gameCollection = gameCollectionsByID[game.type.rawValue]
|
let gameCollection = gameCollectionsByID[game.type.rawValue]
|
||||||
game.gameCollection = gameCollection
|
game.gameCollection = gameCollection
|
||||||
|
|
||||||
Logger.database.debug("Re-associating “\(game.name, privacy: .public)” with GameCollection: \(gameCollection?.identifier ?? "nil", privacy: .public)")
|
Logger.database.notice("Re-associating “\(game.name, privacy: .public)” with GameCollection: \(gameCollection?.identifier ?? "nil", privacy: .public)")
|
||||||
}
|
}
|
||||||
|
|
||||||
try self.managedObjectContext.save()
|
try self.managedObjectContext.save()
|
||||||
@ -178,7 +178,7 @@ private extension RepairDatabaseViewController
|
|||||||
{
|
{
|
||||||
record.perform { managedRecord in
|
record.perform { managedRecord in
|
||||||
// Mark ALL affected GameSaves as conflicted.
|
// Mark ALL affected GameSaves as conflicted.
|
||||||
Logger.database.debug("Marking record \(managedRecord.recordID, privacy: .public) as conflicted.")
|
Logger.database.notice("Marking record \(managedRecord.recordID, privacy: .public) as conflicted.")
|
||||||
managedRecord.isConflicted = true
|
managedRecord.isConflicted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ private extension RepairDatabaseViewController
|
|||||||
|
|
||||||
func repair(_ gameSave: GameSave, backupsDirectory: URL)
|
func repair(_ gameSave: GameSave, backupsDirectory: URL)
|
||||||
{
|
{
|
||||||
Logger.database.debug("Repairing GameSave \(gameSave.identifier, privacy: .public)...")
|
Logger.database.notice("Repairing GameSave \(gameSave.identifier, privacy: .public)...")
|
||||||
|
|
||||||
guard let expectedGame = self.gamesByID?[gameSave.identifier] else {
|
guard let expectedGame = self.gamesByID?[gameSave.identifier] else {
|
||||||
// Game doesn't exist, so we'll back up save file and delete record.
|
// Game doesn't exist, so we'll back up save file and delete record.
|
||||||
@ -296,7 +296,7 @@ private extension RepairDatabaseViewController
|
|||||||
|
|
||||||
func backup(_ gameSave: GameSave, for expectedGame: Game?, to backupsDirectory: URL) throws
|
func backup(_ gameSave: GameSave, for expectedGame: Game?, to backupsDirectory: URL) throws
|
||||||
{
|
{
|
||||||
Logger.database.debug("Backing up GameSave \(gameSave.identifier, privacy: .public). Expected Game: \(expectedGame?.name ?? "nil", privacy: .public)")
|
Logger.database.notice("Backing up GameSave \(gameSave.identifier, privacy: .public). Expected Game: \(expectedGame?.name ?? "nil", privacy: .public)")
|
||||||
|
|
||||||
if let game = gameSave.game
|
if let game = gameSave.game
|
||||||
{
|
{
|
||||||
@ -333,7 +333,7 @@ private extension RepairDatabaseViewController
|
|||||||
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileExtension)
|
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileExtension)
|
||||||
try FileManager.default.copyItem(at: game.gameSaveURL, to: destinationURL, shouldReplace: true)
|
try FileManager.default.copyItem(at: game.gameSaveURL, to: destinationURL, shouldReplace: true)
|
||||||
|
|
||||||
Logger.database.debug("Backed up save file \(game.gameSaveURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
Logger.database.notice("Backed up save file \(game.gameSaveURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
||||||
|
|
||||||
let rtcFileURL = game.gameSaveURL.deletingPathExtension().appendingPathExtension("rtc")
|
let rtcFileURL = game.gameSaveURL.deletingPathExtension().appendingPathExtension("rtc")
|
||||||
if FileManager.default.fileExists(atPath: rtcFileURL.path)
|
if FileManager.default.fileExists(atPath: rtcFileURL.path)
|
||||||
@ -341,7 +341,7 @@ private extension RepairDatabaseViewController
|
|||||||
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension("rtc")
|
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension("rtc")
|
||||||
try FileManager.default.copyItem(at: rtcFileURL, to: destinationURL, shouldReplace: true)
|
try FileManager.default.copyItem(at: rtcFileURL, to: destinationURL, shouldReplace: true)
|
||||||
|
|
||||||
Logger.database.debug("Backed up RTC save file \(rtcFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
Logger.database.notice("Backed up RTC save file \(rtcFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ private extension RepairDatabaseViewController
|
|||||||
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileExtension)
|
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileExtension)
|
||||||
try FileManager.default.copyItem(at: expectedGame.gameSaveURL, to: destinationURL, shouldReplace: true)
|
try FileManager.default.copyItem(at: expectedGame.gameSaveURL, to: destinationURL, shouldReplace: true)
|
||||||
|
|
||||||
Logger.database.debug("Backed up expected save file \(expectedGame.gameSaveURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
Logger.database.notice("Backed up expected save file \(expectedGame.gameSaveURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
||||||
|
|
||||||
let rtcFileURL = expectedGame.gameSaveURL.deletingPathExtension().appendingPathExtension("rtc")
|
let rtcFileURL = expectedGame.gameSaveURL.deletingPathExtension().appendingPathExtension("rtc")
|
||||||
if FileManager.default.fileExists(atPath: rtcFileURL.path)
|
if FileManager.default.fileExists(atPath: rtcFileURL.path)
|
||||||
@ -364,7 +364,7 @@ private extension RepairDatabaseViewController
|
|||||||
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension("rtc")
|
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension("rtc")
|
||||||
try FileManager.default.copyItem(at: rtcFileURL, to: destinationURL, shouldReplace: true)
|
try FileManager.default.copyItem(at: rtcFileURL, to: destinationURL, shouldReplace: true)
|
||||||
|
|
||||||
Logger.database.debug("Backed up expected RTC save file \(rtcFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
Logger.database.notice("Backed up expected RTC save file \(rtcFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,7 +392,7 @@ private extension RepairDatabaseViewController
|
|||||||
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileURL.pathExtension)
|
let destinationURL = backupsDirectory.appendingPathComponent(sanitizedFilename).appendingPathExtension(saveFileURL.pathExtension)
|
||||||
try FileManager.default.copyItem(at: saveFileURL, to: destinationURL, shouldReplace: true)
|
try FileManager.default.copyItem(at: saveFileURL, to: destinationURL, shouldReplace: true)
|
||||||
|
|
||||||
Logger.database.debug("Backed up discovered save file \(saveFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
Logger.database.notice("Backed up discovered save file \(saveFileURL.lastPathComponent, privacy: .public) to \(destinationURL.lastPathComponent, privacy: .public)")
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
@ -278,7 +278,7 @@ private extension ReviewSaveStatesViewController
|
|||||||
let tempGame = self.managedObjectContext.object(with: game.objectID) as! Game
|
let tempGame = self.managedObjectContext.object(with: game.objectID) as! Game
|
||||||
saveState.game = tempGame
|
saveState.game = tempGame
|
||||||
|
|
||||||
Logger.database.debug("Re-associated SaveState “\(saveState.localizedName, privacy: .public)” with game “\(tempGame.name, privacy: .public)”. Previously: \(previousGame?.name ?? "nil", privacy: .public)")
|
Logger.database.notice("Re-associated SaveState “\(saveState.localizedName, privacy: .public)” with game “\(tempGame.name, privacy: .public)”. Previously: \(previousGame?.name ?? "nil", privacy: .public)")
|
||||||
}
|
}
|
||||||
|
|
||||||
self.navigationController?.pushViewController(gamePickerViewController, animated: true)
|
self.navigationController?.pushViewController(gamePickerViewController, animated: true)
|
||||||
|
|||||||
2
External/Harmony
vendored
2
External/Harmony
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 07883cf4d90f4fc841a7162f348ea3b1b438fa50
|
Subproject commit d348fc7440198fd91183d2236e3816dee8cc24ee
|
||||||
Loading…
Reference in New Issue
Block a user