Merge branch 'charlesmchen/logTagProperty'

pull/1/head
Matthew Chen 7 years ago
commit 5053b02681

@ -102,11 +102,11 @@
3478504C1FD7496D007B8332 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B66DBF4919D5BBC8006EA940 /* Images.xcassets */; };
347850551FD749C0007B8332 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B6F509951AA53F760068F56A /* Localizable.strings */; };
347850571FD86544007B8332 /* SAEFailedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347850561FD86544007B8332 /* SAEFailedViewController.swift */; };
347850591FD9972E007B8332 /* SwiftSingletons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347850581FD9972E007B8332 /* SwiftSingletons.swift */; };
347850691FD9B78A007B8332 /* AppSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 347850651FD9B789007B8332 /* AppSetup.m */; };
3478506A1FD9B78A007B8332 /* AppSetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 347850661FD9B789007B8332 /* AppSetup.h */; settings = {ATTRIBUTES = (Public, ); }; };
3478506B1FD9B78A007B8332 /* NoopCallMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347850671FD9B78A007B8332 /* NoopCallMessageHandler.swift */; };
3478506C1FD9B78A007B8332 /* NoopNotificationsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347850681FD9B78A007B8332 /* NoopNotificationsManager.swift */; };
347850591FD9972E007B8332 /* SwiftSingletons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347850581FD9972E007B8332 /* SwiftSingletons.swift */; };
3497DBEC1ECE257500DB2605 /* OWSCountryMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 3497DBEB1ECE257500DB2605 /* OWSCountryMetadata.m */; };
3497DBEF1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3497DBEE1ECE2E4700DB2605 /* DomainFrontingCountryViewController.m */; };
34B0796D1FCF46B100E248C2 /* MainAppContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B0796B1FCF46B000E248C2 /* MainAppContext.m */; };
@ -400,6 +400,13 @@
remoteGlobalIDString = 453518911FC63DBF00210559;
remoteInfo = SignalMessaging;
};
3478506D1FD9CFF4007B8332 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D221A080169C9E5E00537ABF /* Project object */;
proxyType = 1;
remoteGlobalIDString = 453518911FC63DBF00210559;
remoteInfo = SignalMessaging;
};
453518701FC635DD00210559 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D221A080169C9E5E00537ABF /* Project object */;
@ -569,11 +576,11 @@
3472229D1EB22FFE00E53955 /* AddToGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToGroupViewController.h; sourceTree = "<group>"; };
3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToGroupViewController.m; sourceTree = "<group>"; };
347850561FD86544007B8332 /* SAEFailedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SAEFailedViewController.swift; sourceTree = "<group>"; };
347850581FD9972E007B8332 /* SwiftSingletons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSingletons.swift; sourceTree = "<group>"; };
347850651FD9B789007B8332 /* AppSetup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppSetup.m; sourceTree = "<group>"; };
347850661FD9B789007B8332 /* AppSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppSetup.h; sourceTree = "<group>"; };
347850671FD9B78A007B8332 /* NoopCallMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoopCallMessageHandler.swift; sourceTree = "<group>"; };
347850681FD9B78A007B8332 /* NoopNotificationsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoopNotificationsManager.swift; sourceTree = "<group>"; };
347850581FD9972E007B8332 /* SwiftSingletons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftSingletons.swift; sourceTree = "<group>"; };
348F2EAD1F0D21BC00D4ECE0 /* DeviceSleepManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceSleepManager.swift; sourceTree = "<group>"; };
3495BC911F1426B800B478F5 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = translations/ar.lproj/Localizable.strings; sourceTree = "<group>"; };
3497DBEA1ECE257500DB2605 /* OWSCountryMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCountryMetadata.h; sourceTree = "<group>"; };
@ -2134,6 +2141,7 @@
buildRules = (
);
dependencies = (
3478506E1FD9CFF4007B8332 /* PBXTargetDependency */,
B6AFCEBB19A93DA60098CFCB /* PBXTargetDependency */,
);
name = SignalTests;
@ -2922,6 +2930,11 @@
target = 453518911FC63DBF00210559 /* SignalMessaging */;
targetProxy = 34480B391FD0950000BC14EF /* PBXContainerItemProxy */;
};
3478506E1FD9CFF4007B8332 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 453518911FC63DBF00210559 /* SignalMessaging */;
targetProxy = 3478506D1FD9CFF4007B8332 /* PBXContainerItemProxy */;
};
453518711FC635DD00210559 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 453518671FC635DD00210559 /* SignalShareExtension */;

@ -4,6 +4,7 @@
import XCTest
@testable import Signal
@testable import SignalMessaging
class SearcherTest: XCTestCase {

@ -20,7 +20,7 @@ import Foundation
}
// A generic searching class, configurable with an indexing block
class Searcher<T> {
public class Searcher<T> {
private let indexer: (T) -> String

@ -14,15 +14,18 @@ public class SwiftSingletons: NSObject {
}
public func register(_ singleton: AnyObject) {
guard !CurrentAppContext().isRunningTests else {
return
}
guard _isDebugAssertConfiguration() else {
return
}
let singletonClassName = String(describing:type(of:singleton))
guard !classSet.contains(singletonClassName) else {
owsFail("\(self.logTag()) in \(#function) Duplicate singleton: \(singletonClassName).")
owsFail("\(self.logTag) in \(#function) Duplicate singleton: \(singletonClassName).")
return
}
Logger.verbose("\(self.logTag()) in \(#function) Registering singleton: \(singletonClassName).")
Logger.verbose("\(self.logTag) in \(#function) Registering singleton: \(singletonClassName).")
classSet.insert(singletonClassName)
}

@ -8,9 +8,9 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Logging
+ (NSString *)logTag;
@property (nonatomic) NSString *logTag;
- (NSString *)logTag;
+ (NSString *)logTag;
@end

@ -18,7 +18,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
override open func loadView() {
super.loadView()
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
// This should be the first thing we do.
let appContext = ShareAppExtensionContext(rootViewController:self)
@ -103,7 +103,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
}
private func activate() {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
// We don't need to use "screen protection" in the SAE.
@ -162,7 +162,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
func databaseViewRegistrationComplete() {
AssertIsOnMainThread()
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
if TSAccountManager.isRegistered() {
Logger.info("\(self.logTag) localNumber: \(TSAccountManager.localNumber)")
@ -197,7 +197,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
func registrationStateDidChange() {
AssertIsOnMainThread()
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
if TSAccountManager.isRegistered() {
Logger.info("\(self.logTag) localNumber: \(TSAccountManager.localNumber)")
@ -211,7 +211,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
}
private func ensureRootViewController() {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
guard !TSDatabaseView.hasPendingViewRegistrations() else {
return
@ -285,7 +285,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
override open func viewDidLoad() {
super.viewDidLoad()
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
if isReadyForAppExtensions {
activate()
@ -293,19 +293,19 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
}
override open func viewWillAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
super.viewWillAppear(animated)
}
override open func viewDidAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
super.viewDidAppear(animated)
}
override open func viewWillDisappear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
super.viewWillDisappear(animated)
@ -313,7 +313,7 @@ public class ShareViewController: UINavigationController, SAELoadViewDelegate, S
}
override open func viewDidDisappear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
super.viewDidDisappear(animated)

Loading…
Cancel
Save