include more info in logs

This commit is contained in:
ryanzhao 2021-10-05 15:45:54 +11:00
parent f51651ce8e
commit ccbc819cc4
2 changed files with 6 additions and 1 deletions

View File

@ -57,8 +57,11 @@ final class ShareLogsModal : Modal {
// MARK: Interaction // MARK: Interaction
@objc private func shareLogs() { @objc private func shareLogs() {
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
OWSLogger.info("[Version] iOS \(UIDevice.current.systemVersion) \(version)")
DDLog.flushLog()
let logFilePaths = AppEnvironment.shared.fileLogger.logFileManager.sortedLogFilePaths let logFilePaths = AppEnvironment.shared.fileLogger.logFileManager.sortedLogFilePaths
if let latestLogFilePath = logFilePaths.last { if let latestLogFilePath = logFilePaths.first {
let latestLogFileURL = URL(fileURLWithPath: latestLogFilePath) let latestLogFileURL = URL(fileURLWithPath: latestLogFilePath)
self.dismiss(animated: true, completion: { self.dismiss(animated: true, completion: {
AttachmentSharing.showShareUI(for: latestLogFileURL) AttachmentSharing.showShareUI(for: latestLogFileURL)

View File

@ -1,6 +1,8 @@
import SignalCoreKit
public func SNLog(_ message: String) { public func SNLog(_ message: String) {
#if DEBUG #if DEBUG
print("[Session] \(message)") print("[Session] \(message)")
#endif #endif
OWSLogger.info("[Session] \(message)")
} }