Enable logging in SAE; rework log file management to include multiple log directories.

pull/1/head
Matthew Chen 7 years ago
parent 23f151fa50
commit bf21d0c0ed

@ -46,6 +46,8 @@
3461284B1FD0B94000532771 /* SAELoadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3461284A1FD0B93F00532771 /* SAELoadViewController.swift */; }; 3461284B1FD0B94000532771 /* SAELoadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3461284A1FD0B93F00532771 /* SAELoadViewController.swift */; };
346129321FD1A26100532771 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 346129051FD1A25B00532771 /* Localizable.strings */; }; 346129321FD1A26100532771 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 346129051FD1A25B00532771 /* Localizable.strings */; };
346129341FD1A88700532771 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129331FD1A88700532771 /* OWSSwiftUtils.swift */; }; 346129341FD1A88700532771 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129331FD1A88700532771 /* OWSSwiftUtils.swift */; };
346129391FD1B47300532771 /* OWSPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129371FD1B47200532771 /* OWSPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
3461293A1FD1B47300532771 /* OWSPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129381FD1B47200532771 /* OWSPreferences.m */; };
346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */; }; 346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */; };
3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */; }; 3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */; };
3472229F1EB22FFE00E53955 /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */; }; 3472229F1EB22FFE00E53955 /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */; };
@ -299,7 +301,6 @@
76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; }; 76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; };
76EB057A18170B33006006FC /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; }; 76EB057A18170B33006006FC /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; };
76EB058218170B33006006FC /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; }; 76EB058218170B33006006FC /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; };
76EB058818170B33006006FC /* OWSPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* OWSPreferences.m */; };
76EB058A18170B33006006FC /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; }; 76EB058A18170B33006006FC /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; };
76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EB18170B33006006FC /* FunctionalUtil.m */; }; 76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EB18170B33006006FC /* FunctionalUtil.m */; };
76EB063C18170B33006006FC /* NumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04ED18170B33006006FC /* NumberUtil.m */; }; 76EB063C18170B33006006FC /* NumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04ED18170B33006006FC /* NumberUtil.m */; };
@ -354,7 +355,6 @@
B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; }; B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB040918170B33006006FC /* OWSContactsManager.m */; };
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; }; B660F7181C29988E00687D6E /* CryptoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7038632418F70C0700D4A43F /* CryptoTools.m */; };
B660F71B1C29988E00687D6E /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; }; B660F71B1C29988E00687D6E /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041318170B33006006FC /* Environment.m */; };
B660F71F1C29988E00687D6E /* OWSPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041918170B33006006FC /* OWSPreferences.m */; };
B660F7201C29988E00687D6E /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; }; B660F7201C29988E00687D6E /* Release.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB041B18170B33006006FC /* Release.m */; };
B660F7211C29988E00687D6E /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; }; B660F7211C29988E00687D6E /* SignalKeyingStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B1013B196D213F007E3930 /* SignalKeyingStorage.m */; };
B660F7221C29988E00687D6E /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; }; B660F7221C29988E00687D6E /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; };
@ -573,6 +573,8 @@
346129301FD1A26000532771 /* tr_TR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr_TR; path = Signal/translations/tr_TR.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; 346129301FD1A26000532771 /* tr_TR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr_TR; path = Signal/translations/tr_TR.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; };
346129311FD1A26100532771 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Signal/translations/es.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; 346129311FD1A26100532771 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Signal/translations/es.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; };
346129331FD1A88700532771 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; }; 346129331FD1A88700532771 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; };
346129371FD1B47200532771 /* OWSPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSPreferences.h; sourceTree = "<group>"; };
346129381FD1B47200532771 /* OWSPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSPreferences.m; sourceTree = "<group>"; };
346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CropScaleImageViewController.swift; sourceTree = "<group>"; }; 346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CropScaleImageViewController.swift; sourceTree = "<group>"; };
3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewNonContactConversationViewController.h; sourceTree = "<group>"; }; 3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewNonContactConversationViewController.h; sourceTree = "<group>"; };
3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewNonContactConversationViewController.m; sourceTree = "<group>"; }; 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewNonContactConversationViewController.m; sourceTree = "<group>"; };
@ -887,8 +889,6 @@
76EB040918170B33006006FC /* OWSContactsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsManager.m; sourceTree = "<group>"; }; 76EB040918170B33006006FC /* OWSContactsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSContactsManager.m; sourceTree = "<group>"; };
76EB041218170B33006006FC /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = "<group>"; }; 76EB041218170B33006006FC /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = "<group>"; };
76EB041318170B33006006FC /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = "<group>"; }; 76EB041318170B33006006FC /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = "<group>"; };
76EB041818170B33006006FC /* OWSPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSPreferences.h; sourceTree = "<group>"; };
76EB041918170B33006006FC /* OWSPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSPreferences.m; sourceTree = "<group>"; };
76EB041A18170B33006006FC /* Release.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Release.h; sourceTree = "<group>"; }; 76EB041A18170B33006006FC /* Release.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Release.h; sourceTree = "<group>"; };
76EB041B18170B33006006FC /* Release.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Release.m; sourceTree = "<group>"; }; 76EB041B18170B33006006FC /* Release.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Release.m; sourceTree = "<group>"; };
76EB04EA18170B33006006FC /* FunctionalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionalUtil.h; sourceTree = "<group>"; }; 76EB04EA18170B33006006FC /* FunctionalUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionalUtil.h; sourceTree = "<group>"; };
@ -1145,6 +1145,8 @@
34480B4A1FD0A7A200BC14EF /* OWSLogger.h */, 34480B4A1FD0A7A200BC14EF /* OWSLogger.h */,
34480B4B1FD0A7A300BC14EF /* OWSLogger.m */, 34480B4B1FD0A7A300BC14EF /* OWSLogger.m */,
34480B481FD0A60200BC14EF /* OWSMath.h */, 34480B481FD0A60200BC14EF /* OWSMath.h */,
346129371FD1B47200532771 /* OWSPreferences.h */,
346129381FD1B47200532771 /* OWSPreferences.m */,
34480B4F1FD0A7A300BC14EF /* OWSScrubbingLogFormatter.h */, 34480B4F1FD0A7A300BC14EF /* OWSScrubbingLogFormatter.h */,
34480B511FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m */, 34480B511FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m */,
346129331FD1A88700532771 /* OWSSwiftUtils.swift */, 346129331FD1A88700532771 /* OWSSwiftUtils.swift */,
@ -1658,8 +1660,6 @@
45666F731D9BFDB9008FE134 /* Migrations */, 45666F731D9BFDB9008FE134 /* Migrations */,
B6258B311C29E2E60014138E /* NotificationsManager.h */, B6258B311C29E2E60014138E /* NotificationsManager.h */,
B6258B321C29E2E60014138E /* NotificationsManager.m */, B6258B321C29E2E60014138E /* NotificationsManager.m */,
76EB041818170B33006006FC /* OWSPreferences.h */,
76EB041918170B33006006FC /* OWSPreferences.m */,
76EB041A18170B33006006FC /* Release.h */, 76EB041A18170B33006006FC /* Release.h */,
76EB041B18170B33006006FC /* Release.m */, 76EB041B18170B33006006FC /* Release.m */,
B6B1013A196D213F007E3930 /* SignalKeyingStorage.h */, B6B1013A196D213F007E3930 /* SignalKeyingStorage.h */,
@ -2052,6 +2052,7 @@
34480B611FD0A98800BC14EF /* UIColor+OWS.h in Headers */, 34480B611FD0A98800BC14EF /* UIColor+OWS.h in Headers */,
453518961FC63DBF00210559 /* SignalMessaging.h in Headers */, 453518961FC63DBF00210559 /* SignalMessaging.h in Headers */,
34480B631FD0A98800BC14EF /* UIView+OWS.h in Headers */, 34480B631FD0A98800BC14EF /* UIView+OWS.h in Headers */,
346129391FD1B47300532771 /* OWSPreferences.h in Headers */,
34480B5B1FD0A7E300BC14EF /* SignalMessaging-Prefix.pch in Headers */, 34480B5B1FD0A7E300BC14EF /* SignalMessaging-Prefix.pch in Headers */,
34480B681FD0AA9400BC14EF /* UIFont+OWS.h in Headers */, 34480B681FD0AA9400BC14EF /* UIFont+OWS.h in Headers */,
); );
@ -2684,6 +2685,7 @@
34480B621FD0A98800BC14EF /* UIColor+OWS.m in Sources */, 34480B621FD0A98800BC14EF /* UIColor+OWS.m in Sources */,
34480B531FD0A7A400BC14EF /* OWSLogger.m in Sources */, 34480B531FD0A7A400BC14EF /* OWSLogger.m in Sources */,
34480B641FD0A98800BC14EF /* UIView+OWS.m in Sources */, 34480B641FD0A98800BC14EF /* UIView+OWS.m in Sources */,
3461293A1FD1B47300532771 /* OWSPreferences.m in Sources */,
34480B671FD0AA9400BC14EF /* UIFont+OWS.m in Sources */, 34480B671FD0AA9400BC14EF /* UIFont+OWS.m in Sources */,
346129341FD1A88700532771 /* OWSSwiftUtils.swift in Sources */, 346129341FD1A88700532771 /* OWSSwiftUtils.swift in Sources */,
34480B591FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m in Sources */, 34480B591FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m in Sources */,
@ -2882,7 +2884,6 @@
34B3F8941E8DF1710035BE1A /* HomeViewController.m in Sources */, 34B3F8941E8DF1710035BE1A /* HomeViewController.m in Sources */,
34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */, 34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */,
346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */, 346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */,
76EB058818170B33006006FC /* OWSPreferences.m in Sources */,
45E5A6991F61E6DE001E4A8A /* MarqueeLabel.swift in Sources */, 45E5A6991F61E6DE001E4A8A /* MarqueeLabel.swift in Sources */,
34D1F0B01F867BFC0066283D /* OWSSystemMessageCell.m in Sources */, 34D1F0B01F867BFC0066283D /* OWSSystemMessageCell.m in Sources */,
45A663C51F92EC760027B59E /* GroupTableViewCell.swift in Sources */, 45A663C51F92EC760027B59E /* GroupTableViewCell.swift in Sources */,
@ -2913,7 +2914,6 @@
B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */, B660F7171C29988E00687D6E /* OWSContactsManager.m in Sources */,
B660F7181C29988E00687D6E /* CryptoTools.m in Sources */, B660F7181C29988E00687D6E /* CryptoTools.m in Sources */,
B660F71B1C29988E00687D6E /* Environment.m in Sources */, B660F71B1C29988E00687D6E /* Environment.m in Sources */,
B660F71F1C29988E00687D6E /* OWSPreferences.m in Sources */,
451DA3CA1F148A9F008E2423 /* DeviceSleepManager.swift in Sources */, 451DA3CA1F148A9F008E2423 /* DeviceSleepManager.swift in Sources */,
B660F7201C29988E00687D6E /* Release.m in Sources */, B660F7201C29988E00687D6E /* Release.m in Sources */,
45BB93391E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */, 45BB93391E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,

@ -94,16 +94,16 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
// This should be the first thing we do. // This should be the first thing we do.
SetCurrentAppContext([MainAppContext new]); SetCurrentAppContext([MainAppContext new]);
BOOL loggingIsEnabled; BOOL isLoggingEnabled;
#ifdef DEBUG #ifdef DEBUG
// Specified at Product -> Scheme -> Edit Scheme -> Test -> Arguments -> Environment to avoid things like // Specified at Product -> Scheme -> Edit Scheme -> Test -> Arguments -> Environment to avoid things like
// the phone directory being looked up during tests. // the phone directory being looked up during tests.
loggingIsEnabled = TRUE; isLoggingEnabled = TRUE;
[DebugLogger.sharedLogger enableTTYLogging]; [DebugLogger.sharedLogger enableTTYLogging];
#elif RELEASE #elif RELEASE
loggingIsEnabled = OWSPreferences.loggingIsEnabled; isLoggingEnabled = OWSPreferences.isLoggingEnabled;
#endif #endif
if (loggingIsEnabled) { if (isLoggingEnabled) {
[DebugLogger.sharedLogger enableFileLogging]; [DebugLogger.sharedLogger enableFileLogging];
} }
@ -117,7 +117,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
// ensureIsReadyForAppExtensions may have changed the state of the logging // ensureIsReadyForAppExtensions may have changed the state of the logging
// preference (due to [NSUserDefaults migrateToSharedUserDefaults]), so honor // preference (due to [NSUserDefaults migrateToSharedUserDefaults]), so honor
// that change if necessary. // that change if necessary.
if (loggingIsEnabled && !OWSPreferences.loggingIsEnabled) { if (isLoggingEnabled && !OWSPreferences.isLoggingEnabled) {
[DebugLogger.sharedLogger disableFileLogging]; [DebugLogger.sharedLogger disableFileLogging];
} }
#endif #endif

@ -1408,22 +1408,7 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
profileAvatarsDirPath = OWSProfileManager.sharedDataProfileAvatarsDirPath; profileAvatarsDirPath = OWSProfileManager.sharedDataProfileAvatarsDirPath;
BOOL isDirectory; [OWSFileSystem ensureDirectoryExists:profileAvatarsDirPath];
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:profileAvatarsDirPath isDirectory:&isDirectory];
if (exists) {
OWSAssert(isDirectory);
DDLogInfo(@"Profile avatars directory already exists");
} else {
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:profileAvatarsDirPath
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
DDLogError(@"Failed to create profile avatars directory: %@", error);
}
}
[OWSFileSystem protectFolderAtPath:profileAvatarsDirPath]; [OWSFileSystem protectFolderAtPath:profileAvatarsDirPath];
}); });

@ -90,12 +90,12 @@ NS_ASSUME_NONNULL_BEGIN
OWSTableSection *loggingSection = [OWSTableSection new]; OWSTableSection *loggingSection = [OWSTableSection new];
loggingSection.headerTitle = NSLocalizedString(@"LOGGING_SECTION", nil); loggingSection.headerTitle = NSLocalizedString(@"LOGGING_SECTION", nil);
[loggingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"") [loggingSection addItem:[OWSTableItem switchItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_DEBUGLOG", @"")
isOn:[OWSPreferences loggingIsEnabled] isOn:[OWSPreferences isLoggingEnabled]
target:weakSelf target:weakSelf
selector:@selector(didToggleEnableLogSwitch:)]]; selector:@selector(didToggleEnableLogSwitch:)]];
if ([OWSPreferences loggingIsEnabled]) { if ([OWSPreferences isLoggingEnabled]) {
[loggingSection [loggingSection
addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"") addItem:[OWSTableItem actionItemWithText:NSLocalizedString(@"SETTINGS_ADVANCED_SUBMIT_DEBUGLOG", @"")
actionBlock:^{ actionBlock:^{
@ -263,7 +263,7 @@ NS_ASSUME_NONNULL_BEGIN
[[DebugLogger sharedLogger] enableFileLogging]; [[DebugLogger sharedLogger] enableFileLogging];
} }
[OWSPreferences setLoggingEnabled:sender.isOn]; [OWSPreferences setIsLoggingEnabled:sender.isOn];
[self updateTableContents]; [self updateTableContents];
} }

@ -2700,12 +2700,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
{ {
NSString *temporaryDirectory = NSTemporaryDirectory(); NSString *temporaryDirectory = NSTemporaryDirectory();
NSString *videoDirPath = [temporaryDirectory stringByAppendingPathComponent:@"videos"]; NSString *videoDirPath = [temporaryDirectory stringByAppendingPathComponent:@"videos"];
if (![[NSFileManager defaultManager] fileExistsAtPath:videoDirPath]) { [OWSFileSystem ensureDirectoryExists:videoDirPath];
[[NSFileManager defaultManager] createDirectoryAtPath:videoDirPath
withIntermediateDirectories:YES
attributes:nil
error:nil];
}
return [NSURL fileURLWithPath:videoDirPath]; return [NSURL fileURLWithPath:videoDirPath];
} }

@ -8,9 +8,9 @@
#import "OWSTableViewController.h" #import "OWSTableViewController.h"
#import "Signal-Swift.h" #import "Signal-Swift.h"
#import "ThreadUtil.h" #import "ThreadUtil.h"
#import <Curve25519Kit/Randomness.h>
#import <AFNetworking/AFNetworking.h> #import <AFNetworking/AFNetworking.h>
#import <AxolotlKit/PreKeyBundle.h> #import <AxolotlKit/PreKeyBundle.h>
#import <Curve25519Kit/Randomness.h>
#import <SignalServiceKit/OWSBatchMessageProcessor.h> #import <SignalServiceKit/OWSBatchMessageProcessor.h>
#import <SignalServiceKit/OWSDisappearingConfigurationUpdateInfoMessage.h> #import <SignalServiceKit/OWSDisappearingConfigurationUpdateInfoMessage.h>
#import <SignalServiceKit/OWSDisappearingMessagesConfiguration.h> #import <SignalServiceKit/OWSDisappearingMessagesConfiguration.h>
@ -337,19 +337,7 @@ NS_ASSUME_NONNULL_BEGIN
[[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; [[fileManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
NSString *randomFilesDirectoryPath = NSString *randomFilesDirectoryPath =
[[documentDirectoryURL path] stringByAppendingPathComponent:@"cached_random_files"]; [[documentDirectoryURL path] stringByAppendingPathComponent:@"cached_random_files"];
NSError *error; [OWSFileSystem ensureDirectoryExists:randomFilesDirectoryPath];
if (![fileManager fileExistsAtPath:randomFilesDirectoryPath]) {
[fileManager createDirectoryAtPath:randomFilesDirectoryPath
withIntermediateDirectories:YES
attributes:nil
error:&error];
OWSAssert(!error);
if (error) {
DDLogError(@"Error creating directory: %@", error);
failure();
return;
}
}
NSString *filePath = [randomFilesDirectoryPath stringByAppendingPathComponent:filename]; NSString *filePath = [randomFilesDirectoryPath stringByAppendingPathComponent:filename];
if ([fileManager fileExistsAtPath:filePath]) { if ([fileManager fileExistsAtPath:filePath]) {
success(filePath); success(filePath);

@ -27,7 +27,7 @@ static NSString *const OWS102MoveLoggingPreferenceToUserDefaultsMigrationId = @"
if (existingValue) { if (existingValue) {
DDLogInfo(@"%@ assigning existing value: %@", self.logTag, existingValue); DDLogInfo(@"%@ assigning existing value: %@", self.logTag, existingValue);
[OWSPreferences setLoggingEnabled:[existingValue boolValue]]; [OWSPreferences setIsLoggingEnabled:[existingValue boolValue]];
if (![existingValue boolValue]) { if (![existingValue boolValue]) {
DDLogInfo(@"%@ Disabling file logger after one-time log settings migration.", self.logTag); DDLogInfo(@"%@ Disabling file logger after one-time log settings migration.", self.logTag);

@ -3,7 +3,8 @@
// //
#import "Pastelog.h" #import "Pastelog.h"
#include <sys/sysctl.h> #import "DebugLogger.h"
#import <sys/sysctl.h>
@interface Pastelog () @interface Pastelog ()
@ -59,18 +60,21 @@
otherButtonTitles:nil]; otherButtonTitles:nil];
[[self sharedManager].loadingAlertView show]; [[self sharedManager].loadingAlertView show];
NSArray *fileNames = fileLogger.logFileManager.sortedLogFileNames; NSArray<NSString *> *logFilePaths = DebugLogger.sharedLogger.allLogFilePaths;
NSArray *filePaths = fileLogger.logFileManager.sortedLogFilePaths;
NSMutableDictionary *gistFiles = [@{} mutableCopy]; NSMutableDictionary *gistFiles = [NSMutableDictionary new];
NSError *error; for (NSString *logFilePath in logFilePaths) {
NSError *error;
for (unsigned int i = 0; i < [filePaths count]; i++) { NSString *logContents =
[gistFiles setObject:@{@"content":[NSString stringWithContentsOfFile:[filePaths objectAtIndex:i] encoding:NSUTF8StringEncoding error:&error]} forKey:[fileNames objectAtIndex:i]]; [NSString stringWithContentsOfFile:logFilePath encoding:NSUTF8StringEncoding error:&error];
} if (error) {
OWSFail(@"%@ Error loading log file contents: %@", self.logTag, error);
if (error) { continue;
}
gistFiles[logFilePath.lastPathComponent] = @{
@"content" : logContents,
};
} }
NSDictionary *gistDict = @{@"description":[self gistDescription], @"files":gistFiles}; NSDictionary *gistDict = @{@"description":[self gistDescription], @"files":gistFiles};

@ -6,6 +6,8 @@
@interface DebugLogger : NSObject @interface DebugLogger : NSObject
@property (nonatomic) DDFileLogger *fileLogger;
+ (instancetype)sharedLogger; + (instancetype)sharedLogger;
- (void)enableFileLogging; - (void)enableFileLogging;
@ -16,8 +18,6 @@
- (void)wipeLogs; - (void)wipeLogs;
- (NSString *)logsDirectory; - (NSArray<NSString *> *)allLogFilePaths;
@property (nonatomic) DDFileLogger *fileLogger;
@end @end

@ -4,15 +4,13 @@
#import "DebugLogger.h" #import "DebugLogger.h"
#import "OWSScrubbingLogFormatter.h" #import "OWSScrubbingLogFormatter.h"
#import <SignalServiceKit/AppContext.h>
#import <SignalServiceKit/NSDate+OWS.h> #import <SignalServiceKit/NSDate+OWS.h>
#import <SignalServiceKit/OWSFileSystem.h>
#pragma mark Logging - Production logging wants us to write some logs to a file in case we need it for debugging. #pragma mark Logging - Production logging wants us to write some logs to a file in case we need it for debugging.
#import <CocoaLumberjack/DDTTYLogger.h> #import <CocoaLumberjack/DDTTYLogger.h>
@interface DebugLogger ()
@end
@implementation DebugLogger @implementation DebugLogger
+ (instancetype)sharedLogger + (instancetype)sharedLogger
@ -25,11 +23,38 @@
return sharedManager; return sharedManager;
} }
+ (NSString *)mainAppLogsDirPath
{
NSString *dirPath = [[OWSFileSystem cachesDirectoryPath] stringByAppendingPathComponent:@"Logs"];
[OWSFileSystem ensureDirectoryExists:dirPath];
[OWSFileSystem protectFolderAtPath:dirPath];
return dirPath;
}
+ (NSString *)shareExtensionLogsDirPath
{
NSString *dirPath =
[[OWSFileSystem appSharedDataDirectoryPath] stringByAppendingPathComponent:@"ShareExtensionLogs"];
[OWSFileSystem ensureDirectoryExists:dirPath];
[OWSFileSystem protectFolderAtPath:dirPath];
return dirPath;
}
- (NSString *)logsDirPath
{
// This assumes that the only app extension is the share app extension.
return (CurrentAppContext().isMainApp ? DebugLogger.mainAppLogsDirPath : DebugLogger.shareExtensionLogsDirPath);
}
- (void)enableFileLogging - (void)enableFileLogging
{ {
NSString *logsDirPath = [self logsDirPath];
// Logging to file, because it's in the Cache folder, they are not uploaded in iTunes/iCloud backups. // Logging to file, because it's in the Cache folder, they are not uploaded in iTunes/iCloud backups.
self.fileLogger = [DDFileLogger new]; id<DDLogFileManager> logFileManager =
[[DDLogFileManagerDefault alloc] initWithLogsDirectory:logsDirPath defaultFileProtectionLevel:@""];
self.fileLogger = [[DDFileLogger alloc] initWithLogFileManager:logFileManager];
// 24 hour rolling. // 24 hour rolling.
self.fileLogger.rollingFrequency = kDayInterval; self.fileLogger.rollingFrequency = kDayInterval;
// Keep last 3 days of logs - or last 3 logs (if logs rollover due to max file size). // Keep last 3 days of logs - or last 3 logs (if logs rollover due to max file size).
@ -52,22 +77,46 @@
[DDLog addLogger:DDTTYLogger.sharedInstance]; [DDLog addLogger:DDTTYLogger.sharedInstance];
} }
- (NSArray<NSString *> *)allLogFilePaths
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSMutableSet<NSString *> *logPathSet = [NSMutableSet new];
for (NSString *logDirPath in @[
DebugLogger.mainAppLogsDirPath,
DebugLogger.shareExtensionLogsDirPath,
]) {
NSError *error;
for (NSString *filename in [fileManager contentsOfDirectoryAtPath:logDirPath error:&error]) {
NSString *logPath = [logDirPath stringByAppendingPathComponent:filename];
[logPathSet addObject:logPath];
}
if (error) {
OWSFail(@"%@ Failed to find log files: %@", self.logTag, error);
}
}
// To be extra conservative, also add all logs from log file manager.
// This should be redundant with the logic above.
[logPathSet addObjectsFromArray:self.fileLogger.logFileManager.unsortedLogFilePaths];
NSArray<NSString *> *logPaths = logPathSet.allObjects;
return [logPaths sortedArrayUsingSelector:@selector(compare:)];
}
- (void)wipeLogs - (void)wipeLogs
{ {
BOOL reenableLogging = (self.fileLogger ? YES : NO); NSArray<NSString *> *logFilePaths = self.allLogFilePaths;
NSError *error;
NSArray *logsPath = self.fileLogger.logFileManager.unsortedLogFilePaths;
BOOL reenableLogging = (self.fileLogger ? YES : NO);
if (reenableLogging) { if (reenableLogging) {
[self disableFileLogging]; [self disableFileLogging];
} }
for (NSUInteger i = 0; i < logsPath.count; i++) { NSFileManager *fileManager = [NSFileManager defaultManager];
[[NSFileManager defaultManager] removeItemAtPath:[logsPath objectAtIndex:i] error:&error]; NSError *error;
} for (NSString *logFilePath in logFilePaths) {
BOOL success = [fileManager removeItemAtPath:logFilePath error:&error];
if (error) { if (!success || error) {
DDLogError(@"Logs couldn't be removed. %@", error.description); OWSFail(@"%@ Failed to delete log file: %@", self.logTag, error);
}
} }
if (reenableLogging) { if (reenableLogging) {
@ -75,26 +124,4 @@
} }
} }
- (NSString *)logsDirectory
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *baseDir = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSString *logsDirectory = [baseDir stringByAppendingPathComponent:@"Logs"];
if (![[NSFileManager defaultManager] fileExistsAtPath:logsDirectory]) {
NSError *error;
[[NSFileManager defaultManager] createDirectoryAtPath:logsDirectory
withIntermediateDirectories:YES
attributes:nil
error:nil];
if (error) {
DDLogError(@"Log folder couldn't be created. %@", error.description);
}
}
return logsDirectory;
}
@end @end

@ -36,8 +36,8 @@ extern NSString *const OWSPreferencesKeyEnableDebugLog;
- (BOOL)getHasArchivedAMessage; - (BOOL)getHasArchivedAMessage;
- (void)setHasArchivedAMessage:(BOOL)enabled; - (void)setHasArchivedAMessage:(BOOL)enabled;
+ (BOOL)loggingIsEnabled; + (BOOL)isLoggingEnabled;
+ (void)setLoggingEnabled:(BOOL)flag; + (void)setIsLoggingEnabled:(BOOL)flag;
- (BOOL)screenSecurityIsEnabled; - (BOOL)screenSecurityIsEnabled;
- (void)setScreenSecurity:(BOOL)flag; - (void)setScreenSecurity:(BOOL)flag;

@ -3,8 +3,8 @@
// //
#import "OWSPreferences.h" #import "OWSPreferences.h"
#import "TSStorageHeaders.h"
#import <SignalServiceKit/NSUserDefaults+OWS.h> #import <SignalServiceKit/NSUserDefaults+OWS.h>
#import <SignalServiceKit/TSStorageHeaders.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@ -41,7 +41,8 @@ NSString *const OWSPreferencesKey_IsReadyForAppExtensions = @"isReadyForAppExten
#pragma mark - Helpers #pragma mark - Helpers
- (void)clear { - (void)clear
{
[NSUserDefaults removeAll]; [NSUserDefaults removeAll];
} }
@ -108,7 +109,7 @@ NSString *const OWSPreferencesKey_IsReadyForAppExtensions = @"isReadyForAppExten
} }
} }
+ (BOOL)loggingIsEnabled + (BOOL)isLoggingEnabled
{ {
NSNumber *preference = [NSUserDefaults.appUserDefaults objectForKey:OWSPreferencesKeyEnableDebugLog]; NSNumber *preference = [NSUserDefaults.appUserDefaults objectForKey:OWSPreferencesKeyEnableDebugLog];
@ -119,7 +120,7 @@ NSString *const OWSPreferencesKey_IsReadyForAppExtensions = @"isReadyForAppExten
} }
} }
+ (void)setLoggingEnabled:(BOOL)flag + (void)setIsLoggingEnabled:(BOOL)flag
{ {
// Logging preferences are stored in UserDefaults instead of the database, so that we can (optionally) start // Logging preferences are stored in UserDefaults instead of the database, so that we can (optionally) start
// logging before the database is initialized. This is important because sometimes there are problems *with* the // logging before the database is initialized. This is important because sometimes there are problems *with* the

@ -204,22 +204,7 @@ NS_ASSUME_NONNULL_BEGIN
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
attachmentsFolder = TSAttachmentStream.sharedDataAttachmentsDirPath; attachmentsFolder = TSAttachmentStream.sharedDataAttachmentsDirPath;
BOOL isDirectory; [OWSFileSystem ensureDirectoryExists:attachmentsFolder];
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:attachmentsFolder isDirectory:&isDirectory];
if (exists) {
OWSAssert(isDirectory);
DDLogInfo(@"Attachments directory already exists");
} else {
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:attachmentsFolder
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
DDLogError(@"Failed to create attachments directory: %@", error);
}
}
[OWSFileSystem protectFolderAtPath:attachmentsFolder]; [OWSFileSystem protectFolderAtPath:attachmentsFolder];
}); });

@ -388,23 +388,9 @@ void setDatabaseInitialized()
{ {
NSString *databaseDirPath = [[OWSFileSystem appSharedDataDirectoryPath] stringByAppendingPathComponent:@"database"]; NSString *databaseDirPath = [[OWSFileSystem appSharedDataDirectoryPath] stringByAppendingPathComponent:@"database"];
NSFileManager *fileManager = [NSFileManager defaultManager]; if (![OWSFileSystem ensureDirectoryExists:databaseDirPath]) {
if (![fileManager fileExistsAtPath:databaseDirPath]) { [NSException raise:TSStorageManagerExceptionName_CouldNotCreateDatabaseDirectory
NSError *_Nullable error; format:@"Could not create new database directory"];
BOOL success = [fileManager createDirectoryAtPath:databaseDirPath
withIntermediateDirectories:NO
attributes:nil
error:&error];
if (!success || error) {
NSString *errorDescription =
[NSString stringWithFormat:@"%@ Could not create new database directory: %@, error: %@",
self.logTag,
databaseDirPath,
error];
OWSFail(@"%@", errorDescription);
[NSException raise:TSStorageManagerExceptionName_CouldNotCreateDatabaseDirectory
format:@"%@", errorDescription];
}
} }
return databaseDirPath; return databaseDirPath;
} }

@ -3,6 +3,7 @@
// //
#import "MIMETypeUtil.h" #import "MIMETypeUtil.h"
#import "OWSFileSystem.h"
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
#import <MobileCoreServices/MobileCoreServices.h> #import <MobileCoreServices/MobileCoreServices.h>
@ -321,15 +322,8 @@ NSString *const kSyncMessageFileExtension = @"bin";
NSString *attachmentFolderPath = [folder stringByAppendingPathComponent:uniqueId]; NSString *attachmentFolderPath = [folder stringByAppendingPathComponent:uniqueId];
NSError *error = nil; NSError *error = nil;
BOOL attachmentFolderPathExists = [[NSFileManager defaultManager] fileExistsAtPath:attachmentFolderPath]; BOOL attachmentFolderPathExists = [[NSFileManager defaultManager] fileExistsAtPath:attachmentFolderPath];
if (!attachmentFolderPathExists) { if (![OWSFileSystem ensureDirectoryExists:attachmentFolderPath]) {
[[NSFileManager defaultManager] createDirectoryAtPath:attachmentFolderPath return nil;
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
OWSFail(@"Failed to create attachment directory: %@", error);
return nil;
}
} }
return [attachmentFolderPath return [attachmentFolderPath
stringByAppendingPathComponent:[NSString stringByAppendingPathComponent:[NSString

@ -14,10 +14,15 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)appSharedDataDirectoryPath; + (NSString *)appSharedDataDirectoryPath;
+ (NSString *)cachesDirectoryPath;
+ (void)moveAppFilePath:(NSString *)oldFilePath + (void)moveAppFilePath:(NSString *)oldFilePath
sharedDataFilePath:(NSString *)newFilePath sharedDataFilePath:(NSString *)newFilePath
exceptionName:(NSString *)exceptionName; exceptionName:(NSString *)exceptionName;
// Returns NO IFF the directory does not exist and could not be created.
+ (BOOL)ensureDirectoryExists:(NSString *)dirPath;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -44,6 +44,13 @@ NS_ASSUME_NONNULL_BEGIN
return [groupContainerDirectoryURL path]; return [groupContainerDirectoryURL path];
} }
+ (NSString *)cachesDirectoryPath
{
NSArray<NSString *> *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
OWSAssert(paths.count >= 1);
return paths[0];
}
+ (void)moveAppFilePath:(NSString *)oldFilePath + (void)moveAppFilePath:(NSString *)oldFilePath
sharedDataFilePath:(NSString *)newFilePath sharedDataFilePath:(NSString *)newFilePath
exceptionName:(NSString *)exceptionName exceptionName:(NSString *)exceptionName
@ -82,6 +89,28 @@ NS_ASSUME_NONNULL_BEGIN
fabs([startDate timeIntervalSinceNow])); fabs([startDate timeIntervalSinceNow]));
} }
+ (BOOL)ensureDirectoryExists:(NSString *)dirPath
{
BOOL isDirectory;
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:dirPath isDirectory:&isDirectory];
if (exists) {
OWSAssert(isDirectory);
return YES;
} else {
NSError *error = nil;
[[NSFileManager defaultManager] createDirectoryAtPath:dirPath
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
OWSFail(@"%@ Failed to create directory: %@, error: %@", self.logTag, dirPath, error);
return NO;
}
return YES;
}
}
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -16,37 +16,19 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
// This should be the first thing we do. // This should be the first thing we do.
SetCurrentAppContext(ShareAppExtensionContext()) SetCurrentAppContext(ShareAppExtensionContext())
// DebugLogger.shared().enableTTYLogging() DebugLogger.shared().enableTTYLogging()
// if _isDebugAssertConfiguration() { if _isDebugAssertConfiguration() {
// DebugLogger.shared().enableFileLogging() DebugLogger.shared().enableFileLogging()
// } else { } else if (OWSPreferences.isLoggingEnabled()) {
// // TODO: Consult OWSPreferences.loggingIsEnabled. // TODO: Consult OWSPreferences.isLoggingEnabled.
// DebugLogger.shared().enableFileLogging() DebugLogger.shared().enableFileLogging()
// } }
_ = AppVersion() _ = AppVersion()
//DDLogWarn(@"%@ application: didFinishLaunchingWithOptions.", self.logTag);
//
//// We need to do this _after_ we set up logging but _before_ we do
//// anything else.
//[self ensureIsReadyForAppExtensions];
//
//#if RELEASE
// // ensureIsReadyForAppExtensions may have changed the state of the logging
// // preference (due to [NSUserDefaults migrateToSharedUserDefaults]), so honor
// // that change if necessary.
//if (loggingIsEnabled && !OWSPreferences.loggingIsEnabled) {
// [DebugLogger.sharedLogger disableFileLogging];
//}
//#endif
//
//[AppVersion instance];
//
//[self startupLogging]; //[self startupLogging];
Logger.debug("\(self.logTag()) \(#function)") Logger.debug("\(self.logTag()) \(#function)")
print("\(self.logTag()) \(#function) \(self.view.frame)")
let loadViewController = SAELoadViewController(delegate:self) let loadViewController = SAELoadViewController(delegate:self)
self.pushViewController(loadViewController, animated: false) self.pushViewController(loadViewController, animated: false)
@ -63,22 +45,19 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
//let proofOfSharedStorage = TSAccountManager.localNumber() //let proofOfSharedStorage = TSAccountManager.localNumber()
let proofOfSharedStorage = "TODO" let proofOfSharedStorage = "TODO"
print("shared framework: \(proofOfSharedFramework) \n sharedStorage: \(proofOfSharedStorage) \n proof of ssk: \(proofOfSSK)") Logger.debug("shared framework: \(proofOfSharedFramework) \n sharedStorage: \(proofOfSharedStorage) \n proof of ssk: \(proofOfSSK)")
Logger.debug("\(self.logTag()) \(#function)") Logger.debug("\(self.logTag()) \(#function)")
print("\(self.logTag()) \(#function) \(self.view.frame)")
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)") Logger.debug("\(self.logTag()) \(#function)")
print("\(self.logTag()) \(#function) \(self.view.frame)")
super.viewWillAppear(animated) super.viewWillAppear(animated)
} }
override func viewDidAppear(_ animated: Bool) { override func viewDidAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)") Logger.debug("\(self.logTag()) \(#function)")
print("\(self.logTag()) \(#function) \(self.view.frame)")
super.viewDidAppear(animated) super.viewDidAppear(animated)
} }

@ -9,6 +9,7 @@
#import "UIFont+OWS.h" #import "UIFont+OWS.h"
#import "UIView+OWS.h" #import "UIView+OWS.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <SignalMessaging/OWSPreferences.h>
#import <SignalServiceKit/AppContext.h> #import <SignalServiceKit/AppContext.h>
#import <SignalServiceKit/AppVersion.h> #import <SignalServiceKit/AppVersion.h>
#import <SignalServiceKit/Asserts.h> #import <SignalServiceKit/Asserts.h>

Loading…
Cancel
Save