Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent dd4f1babba
commit f34bdd34bc

@ -72,10 +72,10 @@ class CompareSafetyNumbersActivity: UIActivity {
let pasteboardSafetyNumbers = pasteboardString! let pasteboardSafetyNumbers = pasteboardString!
if pasteboardSafetyNumbers == mySafetyNumbers { if pasteboardSafetyNumbers == mySafetyNumbers {
Logger.info("successfully matched safety numbers. local numbers: \(String(describing: mySafetyNumbers)) pasteboard:\(pasteboardSafetyNumbers)") Logger.info("successfully matched safety numbers. local numbers: \(String(describing: self.mySafetyNumbers)) pasteboard:\(pasteboardSafetyNumbers)")
delegate.compareSafetyNumbersActivitySucceeded(activity: self) delegate.compareSafetyNumbersActivitySucceeded(activity: self)
} else { } else {
Logger.warn("local numbers: \(String(describing: mySafetyNumbers)) didn't match pasteboard:\(pasteboardSafetyNumbers)") Logger.warn("local numbers: \(String(describing: self.mySafetyNumbers)) didn't match pasteboard:\(pasteboardSafetyNumbers)")
let error = OWSErrorWithCodeDescription(OWSErrorCode.privacyVerificationFailure, let error = OWSErrorWithCodeDescription(OWSErrorCode.privacyVerificationFailure,
NSLocalizedString("PRIVACY_VERIFICATION_FAILED_MISMATCHED_SAFETY_NUMBERS_IN_CLIPBOARD", comment: "Alert body")) NSLocalizedString("PRIVACY_VERIFICATION_FAILED_MISMATCHED_SAFETY_NUMBERS_IN_CLIPBOARD", comment: "Alert body"))
delegate.compareSafetyNumbersActivity(self, failedWithError: error) delegate.compareSafetyNumbersActivity(self, failedWithError: error)

@ -102,7 +102,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
// MARK: - Audio Source // MARK: - Audio Source
var hasAlternateAudioSources: Bool { var hasAlternateAudioSources: Bool {
Logger.info("available audio sources: \(allAudioSources)") Logger.info("available audio sources: \(self.allAudioSources)")
// internal mic and speakerphone will be the first two, any more than one indicates e.g. an attached bluetooth device. // internal mic and speakerphone will be the first two, any more than one indicates e.g. an attached bluetooth device.
// TODO is this sufficient? Are their devices w/ bluetooth but no external speaker? e.g. ipod? // TODO is this sufficient? Are their devices w/ bluetooth but no external speaker? e.g. ipod?

@ -22,7 +22,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
private var viewMode = ViewMode.idle { private var viewMode = ViewMode.idle {
didSet { didSet {
Logger.info("viewMode: \(viewMode)") Logger.info("viewMode: \(self.viewMode)")
updateContents() updateContents()
} }
@ -301,7 +301,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCellReuseIdentifier, for: indexPath) let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCellReuseIdentifier, for: indexPath)
guard indexPath.row < imageInfos.count else { guard indexPath.row < imageInfos.count else {
Logger.warn("indexPath: \(indexPath.row) out of range for imageInfo count: \(imageInfos.count) ") Logger.warn("indexPath: \(indexPath.row) out of range for imageInfo count: \(self.imageInfos.count) ")
return cell return cell
} }
let imageInfo = imageInfos[indexPath.row] let imageInfo = imageInfos[indexPath.row]

@ -96,7 +96,7 @@ public class OWS2FAReminderViewController: UIViewController, PinEntryViewDelegat
} }
private func didSubmitCorrectPin() { private func didSubmitCorrectPin() {
Logger.info("noWrongGuesses: \(noWrongGuesses)") Logger.info("noWrongGuesses: \(self.noWrongGuesses)")
self.dismiss(animated: true) self.dismiss(animated: true)

@ -138,7 +138,7 @@ private class SignalCallData: NSObject {
didSet { didSet {
AssertIsOnMainThread() AssertIsOnMainThread()
Logger.info("\(isRemoteVideoEnabled)") Logger.info("\(self.isRemoteVideoEnabled)")
} }
} }

@ -19,7 +19,7 @@ public class OutageDetection: NSObject {
AssertIsOnMainThread() AssertIsOnMainThread()
if hasOutage != oldValue { if hasOutage != oldValue {
Logger.info("hasOutage: \(hasOutage).") Logger.info("hasOutage: \(self.hasOutage).")
NotificationCenter.default.postNotificationNameAsync(OutageDetection.outageStateDidChange, object: nil) NotificationCenter.default.postNotificationNameAsync(OutageDetection.outageStateDidChange, object: nil)
} }

@ -21,7 +21,7 @@ public func owsFormatLogMessage(_ logString: String,
*/ */
open class Logger: NSObject { open class Logger: NSObject {
open class func verbose(_ logString: @escaping @autoclosure () -> String, open class func verbose(_ logString: @autoclosure () -> String,
file: String = #file, file: String = #file,
function: String = #function, function: String = #function,
line: Int = #line) { line: Int = #line) {
@ -31,7 +31,7 @@ open class Logger: NSObject {
OWSLogger.verbose(owsFormatLogMessage(logString(), file: file, function: function, line: line)) OWSLogger.verbose(owsFormatLogMessage(logString(), file: file, function: function, line: line))
} }
open class func debug(_ logString: @escaping @autoclosure () -> String, open class func debug(_ logString: @autoclosure () -> String,
file: String = #file, file: String = #file,
function: String = #function, function: String = #function,
line: Int = #line) { line: Int = #line) {
@ -41,34 +41,34 @@ open class Logger: NSObject {
OWSLogger.debug(owsFormatLogMessage(logString(), file: file, function: function, line: line)) OWSLogger.debug(owsFormatLogMessage(logString(), file: file, function: function, line: line))
} }
open class func info(_ logString: String, open class func info(_ logString: @autoclosure () -> String,
file: String = #file, file: String = #file,
function: String = #function, function: String = #function,
line: Int = #line) { line: Int = #line) {
guard ShouldLogInfo() else { guard ShouldLogInfo() else {
return return
} }
OWSLogger.info(owsFormatLogMessage(logString, file: file, function: function, line: line)) OWSLogger.info(owsFormatLogMessage(logString(), file: file, function: function, line: line))
} }
open class func warn(_ logString: String, open class func warn(_ logString: @autoclosure () -> String,
file: String = #file, file: String = #file,
function: String = #function, function: String = #function,
line: Int = #line) { line: Int = #line) {
guard ShouldLogWarning() else { guard ShouldLogWarning() else {
return return
} }
OWSLogger.warn(owsFormatLogMessage(logString, file: file, function: function, line: line)) OWSLogger.warn(owsFormatLogMessage(logString(), file: file, function: function, line: line))
} }
open class func error(_ logString: String, open class func error(_ logString: @autoclosure () -> String,
file: String = #file, file: String = #file,
function: String = #function, function: String = #function,
line: Int = #line) { line: Int = #line) {
guard ShouldLogError() else { guard ShouldLogError() else {
return return
} }
OWSLogger.error(owsFormatLogMessage(logString, file: file, function: function, line: line)) OWSLogger.error(owsFormatLogMessage(logString(), file: file, function: function, line: line))
} }
open class func flush() { open class func flush() {
Loading…
Cancel
Save