Skip to content

Commit

Permalink
fix: Add additional diagnostic logging (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
crleona authored Jun 11, 2024
1 parent eaf6d16 commit e0e47a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Amplitude/Storages/PersistentStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class PersistentStorage: Storage {
return readV1File(content: content!)
}
} catch {
diagonostics.addErrorLog(error.localizedDescription)
logger?.error(message: error.localizedDescription)
}
return content
Expand All @@ -101,6 +102,7 @@ class PersistentStorage: Storage {
do {
try fileManager.removeItem(atPath: eventBlock.path)
} catch {
diagonostics.addErrorLog(error.localizedDescription)
logger?.error(message: error.localizedDescription)
}
}
Expand All @@ -117,6 +119,7 @@ class PersistentStorage: Storage {
do {
try fileManager.removeItem(atPath: eventBlock.path)
} catch {
diagonostics.addErrorLog(error.localizedDescription)
logger?.error(message: error.localizedDescription)
}
}
Expand Down Expand Up @@ -349,6 +352,7 @@ extension PersistentStorage {
}
try outputStream?.write("\(jsonString)\(PersistentStorage.DELMITER)")
} catch {
diagonostics.addErrorLog(error.localizedDescription)
logger?.error(message: error.localizedDescription)
}
finish(file: storeFile)
Expand All @@ -359,6 +363,7 @@ extension PersistentStorage {
outputStream = try OutputFileStream(fileURL: file)
try outputStream?.create()
} catch {
diagonostics.addErrorLog(error.localizedDescription)
logger?.error(message: error.localizedDescription)
}
}
Expand Down

0 comments on commit e0e47a7

Please sign in to comment.