Convert logTag to property.

pull/1/head
Matthew Chen 7 years ago
parent c36c4d6ec3
commit f148003fb3

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

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

Loading…
Cancel
Save