mirror of
https://github.com/signalapp/Signal-iOS.git
synced 2025-12-05 01:10:41 +00:00
Always flush logger in owsFailDebug
This commit is contained in:
@@ -36,10 +36,8 @@ class NSEEnvironment {
|
||||
didStartAppSetup = true
|
||||
}
|
||||
|
||||
logger.info(
|
||||
"pid: \(ProcessInfo.processInfo.processIdentifier), memoryUsage: \(LocalDevice.memoryUsageString)",
|
||||
flushImmediately: true
|
||||
)
|
||||
logger.info("pid: \(ProcessInfo.processInfo.processIdentifier), memoryUsage: \(LocalDevice.memoryUsageString)")
|
||||
logger.flush()
|
||||
}
|
||||
|
||||
@MainActor
|
||||
|
||||
@@ -104,7 +104,8 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
// Detect and handle "no GRDB file" and "no keychain access".
|
||||
if !hasShownFirstUnlockError {
|
||||
hasShownFirstUnlockError = true
|
||||
logger.error("DB Keys not accessible; showing error.", flushImmediately: true)
|
||||
logger.error("DB Keys not accessible; showing error.")
|
||||
logger.flush()
|
||||
let content = UNMutableNotificationContent()
|
||||
let notificationFormat = OWSLocalizedString(
|
||||
"NOTIFICATION_BODY_PHONE_LOCKED_FORMAT",
|
||||
@@ -115,7 +116,8 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
} else {
|
||||
// Only show a single error if we receive multiple pushes
|
||||
// before first device unlock.
|
||||
logger.error("DB Keys not accessible; completing silently.", flushImmediately: true)
|
||||
logger.error("DB Keys not accessible; completing silently.")
|
||||
logger.flush()
|
||||
let emptyContent = UNMutableNotificationContent()
|
||||
return emptyContent
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public func owsFailBeta(
|
||||
if FeatureFlags.isPrerelease {
|
||||
owsFail(logMessage, file: file, function: function, line: line)
|
||||
} else {
|
||||
Logger.error(logMessage, file: file, function: function, line: line)
|
||||
owsFailDebug(logMessage, file: file, function: function, line: line)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ public func owsFailDebug(
|
||||
line: Int = #line
|
||||
) {
|
||||
logger.error(logMessage, file: file, function: function, line: line)
|
||||
logger.flush()
|
||||
if IsDebuggerAttached() {
|
||||
TrapDebugger()
|
||||
} else if Preferences.isFailDebugEnabled {
|
||||
Preferences.setIsFailDebugEnabled(false)
|
||||
logger.flush()
|
||||
fatalError(logMessage)
|
||||
} else {
|
||||
assertionFailure(logMessage)
|
||||
@@ -67,7 +67,6 @@ public func owsFail(
|
||||
) -> Never {
|
||||
logger.error(Thread.callStackSymbols.joined(separator: "\n"))
|
||||
owsFailDebug(logMessage, logger: logger, file: file, function: function, line: line)
|
||||
logger.flush()
|
||||
fatalError(logMessage)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ open class PrefixedLogger {
|
||||
|
||||
open func verbose(
|
||||
_ logString: @autoclosure () -> String,
|
||||
flushImmediately: Bool = false,
|
||||
file: String = #fileID,
|
||||
function: String = #function,
|
||||
line: Int = #line
|
||||
@@ -43,13 +42,10 @@ open class PrefixedLogger {
|
||||
function: function,
|
||||
line: line
|
||||
)
|
||||
|
||||
if flushImmediately { flush() }
|
||||
}
|
||||
|
||||
open func debug(
|
||||
_ logString: @autoclosure () -> String,
|
||||
flushImmediately: Bool = false,
|
||||
file: String = #fileID,
|
||||
function: String = #function,
|
||||
line: Int = #line
|
||||
@@ -60,13 +56,10 @@ open class PrefixedLogger {
|
||||
function: function,
|
||||
line: line
|
||||
)
|
||||
|
||||
if flushImmediately { flush() }
|
||||
}
|
||||
|
||||
open func info(
|
||||
_ logString: @autoclosure () -> String,
|
||||
flushImmediately: Bool = false,
|
||||
file: String = #fileID,
|
||||
function: String = #function,
|
||||
line: Int = #line
|
||||
@@ -77,13 +70,10 @@ open class PrefixedLogger {
|
||||
function: function,
|
||||
line: line
|
||||
)
|
||||
|
||||
if flushImmediately { flush() }
|
||||
}
|
||||
|
||||
open func warn(
|
||||
_ logString: @autoclosure () -> String,
|
||||
flushImmediately: Bool = false,
|
||||
file: String = #fileID,
|
||||
function: String = #function,
|
||||
line: Int = #line
|
||||
@@ -94,13 +84,10 @@ open class PrefixedLogger {
|
||||
function: function,
|
||||
line: line
|
||||
)
|
||||
|
||||
if flushImmediately { flush() }
|
||||
}
|
||||
|
||||
open func error(
|
||||
_ logString: @autoclosure () -> String,
|
||||
flushImmediately: Bool = false,
|
||||
file: String = #fileID,
|
||||
function: String = #function,
|
||||
line: Int = #line
|
||||
@@ -111,8 +98,6 @@ open class PrefixedLogger {
|
||||
function: function,
|
||||
line: line
|
||||
)
|
||||
|
||||
if flushImmediately { flush() }
|
||||
}
|
||||
|
||||
open func flush() {
|
||||
|
||||
Reference in New Issue
Block a user