IOS-1467 remove old log IOS-1467
authorAlejandro Gelos <agp@pep.security>
Mon, 15 Apr 2019 14:29:14 +0200
branchIOS-1467
changeset 823417dbcc19dd8d
parent 8233 88eb0c6e7e9d
child 8235 c24dc73d5185
IOS-1467 remove old log
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/AppDelegate.swift
pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift
pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift
pEpForiOS/Models/Log.swift
pEpForiOS/Models/Server+Fetching.swift
pEpForiOS/UI/Background/ReevaluateMessageRatingOperation.swift
pEpForiOS/UI/Compose/Cells/AccountCell/AccountCell.swift
pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift
pEpForiOS/UI/Compose/Cells/BodyCell/BodyCellViewModel.swift
pEpForiOS/UI/Compose/Cells/BodyCell/NSAttributedString+BodyTextUtils.swift
pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextView.swift
pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift
pEpForiOS/UI/Compose/ComposeTableViewController.swift
pEpForiOS/UI/Compose/Util/ComposeUtil.swift
pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift
pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift
pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift
pEpForiOS/UI/Compose/ViewModel/ComposeViewModel.swift
pEpForiOS/UI/Compose/ViewModel/ComposeViewModelState.swift
pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift
pEpForiOS/UI/EmailDisplay/EmailViewController.swift
pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift
pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift
pEpForiOS/UI/Filter/ViewModel/FilterViewModel.swift
pEpForiOS/UI/Folder/FolderTableViewController.swift
pEpForiOS/UI/Folder/ViewModel/FolderSectionViewModel.swift
pEpForiOS/UI/Handshake/HandshakeViewController.swift
pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift
pEpForiOS/UI/Login/LoginViewController.swift
pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift
pEpForiOS/UI/ManualLogin/SMTPSetup/SMTPSettingsTableViewController.swift
pEpForiOS/UI/MoveToFolder/ViewModel/MoveToFolderViewModel.swift
pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift
pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift
pEpForiOS/UI/Settings/Setting/LogViewController.swift
pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewController.swift
pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewModel.swift
pEpForiOS/UI/Settings/SettingsTableViewController.swift
pEpForiOS/UI/Settings/ViewModel/SettingsCellViewModel.swift
pEpForiOS/UI/SplitView/PrimarySplitViewcontroller+ScreenComposerProtocol.swift
pEpForiOS/UI/Thread/Cells/FullMessageCell.swift
pEpForiOS/UI/Thread/ThreadViewController+SegueHandlerType.swift
pEpForiOS/UI/Thread/ThreadViewController.swift
pEpForiOS/UI/Util/AddToContactsViewController/AddToContactsViewController.swift
pEpForiOS/UI/Util/BaseTableViewController.swift
pEpForiOS/UI/Util/BaseViewController.swift
pEpForiOS/UI/Util/Extensions/UIView+Autolayout.swift
pEpForiOS/UI/Util/InfoPlist.swift
pEpForiOS/UI/Util/SecureWebViewController/CidHandler.swift
pEpForiOS/UI/Util/SecureWebViewController/SecureWebViewController.swift
pEpForiOS/UI/Util/SuggestTableViewController/SuggestTableViewController.swift
pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift
pEpForiOS/UI/Util/UIUtils.swift
pEpForiOS/Util/DebugMergePolicy.swift
pEpForiOS/Util/Extensions/ConnectionTransport+AccountSettings.swift
pEpForiOS/Util/Extensions/PEP_rating+Extension.swift
pEpForiOS/Util/Log/Log+ASL.swift
pEpForiOS/Util/Log/Log.swift
pEpForiOS/Util/ReferenceCounter.swift
pEpForiOS/Util/UserNotificationTool.swift
subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift
     1.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Fri Apr 12 13:52:08 2019 +0200
     1.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Mon Apr 15 14:29:14 2019 +0200
     1.3 @@ -58,21 +58,6 @@
     1.4          }
     1.5      }
     1.6  
     1.7 -    //!!!: remove this loggers  from to the app if any
     1.8 -
     1.9 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.10 -    public static let frontendLogger = Logger(category: "frontend")
    1.11 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.12 -    public static let backendLogger = Logger(category: "backend")
    1.13 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.14 -    public static let utilLogger = Logger(category: "util")
    1.15 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.16 -    public static let htmlParsingLogger = Logger(category: "htmlParsing")
    1.17 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.18 -    public static let modelLogger = Logger(category: "model")
    1.19 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    1.20 -    public static let appDelegateLogger = Logger(category: "appDelegate")
    1.21 -
    1.22      public init(subsystem: String = "security.pEp.app.iOS", category: String) {
    1.23          self.subsystem = subsystem
    1.24          self.category = category
     2.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Fri Apr 12 13:52:08 2019 +0200
     2.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Mon Apr 15 14:29:14 2019 +0200
     2.3 @@ -192,6 +192,7 @@
     2.4  		220DCE371E0AB5CC002FE716 /* MessageSubjectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 220DCE331E0AB5CC002FE716 /* MessageSubjectCell.swift */; };
     2.5  		222B35581DF96389007A1F82 /* Capability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 222B35571DF96389007A1F82 /* Capability.swift */; };
     2.6  		228038681DC9DE6D00F1CB45 /* TextfieldResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 228038671DC9DE6D00F1CB45 /* TextfieldResponder.swift */; };
     2.7 +		37C3C0E62260C64D003E290C /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C3C0E52260C64D003E290C /* Log.swift */; };
     2.8  		43040A531E9776220083DED8 /* AttachmentSummaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43040A521E9776220083DED8 /* AttachmentSummaryView.swift */; };
     2.9  		4304FD001EBB8EBB0086DADA /* LanguageListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4304FCFE1EBB8C5A0086DADA /* LanguageListViewController.swift */; };
    2.10  		430BA229203438A3003B041C /* CdMessagePEPMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430BA228203438A3003B041C /* CdMessagePEPMessageTests.swift */; };
    2.11 @@ -416,8 +417,6 @@
    2.12  		A1014DA71D1173CD00C472A8 /* UIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 436C5A8D1CFEDF59006A195F /* UIHelper.swift */; };
    2.13  		A1B50A841CD26FF100B1A997 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1B50A811CD26FF100B1A997 /* Constants.swift */; };
    2.14  		B70A3A63220065F600EDCE61 /* String+pEp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A62220065F500EDCE61 /* String+pEp.swift */; };
    2.15 -		B70A3A9322089D5000EDCE61 /* Log+ASL.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A9122089D5000EDCE61 /* Log+ASL.swift */; };
    2.16 -		B70A3A9422089D5000EDCE61 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A9222089D5000EDCE61 /* Log.swift */; };
    2.17  		B70A3C401E817CFA0036876F /* FolderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3C3F1E817CFA0036876F /* FolderViewModel.swift */; };
    2.18  		B716056020D3ECC900A733D6 /* MoveToFolderTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B716055F20D3ECC900A733D6 /* MoveToFolderTableViewController.swift */; };
    2.19  		B71EBBBC1E55E4AE00150177 /* FolderTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B71EBBBB1E55E4AE00150177 /* FolderTableViewController.swift */; };
    2.20 @@ -675,6 +674,7 @@
    2.21  		220DCE331E0AB5CC002FE716 /* MessageSubjectCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageSubjectCell.swift; sourceTree = "<group>"; };
    2.22  		222B35571DF96389007A1F82 /* Capability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capability.swift; sourceTree = "<group>"; };
    2.23  		228038671DC9DE6D00F1CB45 /* TextfieldResponder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextfieldResponder.swift; sourceTree = "<group>"; };
    2.24 +		37C3C0E52260C64D003E290C /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
    2.25  		43040A521E9776220083DED8 /* AttachmentSummaryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentSummaryView.swift; sourceTree = "<group>"; };
    2.26  		4304FCFE1EBB8C5A0086DADA /* LanguageListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageListViewController.swift; sourceTree = "<group>"; };
    2.27  		430BA228203438A3003B041C /* CdMessagePEPMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CdMessagePEPMessageTests.swift; sourceTree = "<group>"; };
    2.28 @@ -933,8 +933,6 @@
    2.29  		8B69E3981E30F80E0022959E /* Appearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Appearance.swift; sourceTree = "<group>"; };
    2.30  		A1B50A811CD26FF100B1A997 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
    2.31  		B70A3A62220065F500EDCE61 /* String+pEp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+pEp.swift"; sourceTree = "<group>"; };
    2.32 -		B70A3A9122089D5000EDCE61 /* Log+ASL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Log+ASL.swift"; sourceTree = "<group>"; };
    2.33 -		B70A3A9222089D5000EDCE61 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
    2.34  		B70A3C3F1E817CFA0036876F /* FolderViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FolderViewModel.swift; path = Folder/ViewModel/FolderViewModel.swift; sourceTree = "<group>"; };
    2.35  		B716055F20D3ECC900A733D6 /* MoveToFolderTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoveToFolderTableViewController.swift; sourceTree = "<group>"; };
    2.36  		B71EBBBB1E55E4AE00150177 /* FolderTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FolderTableViewController.swift; path = Folder/FolderTableViewController.swift; sourceTree = "<group>"; };
    2.37 @@ -1880,7 +1878,6 @@
    2.38  		43980EDE1CBD24B000A7FC3C /* Util */ = {
    2.39  			isa = PBXGroup;
    2.40  			children = (
    2.41 -				B70A3A9022089D3C00EDCE61 /* Log */,
    2.42  				4362398D1EAE08F400BD2EB9 /* Extensions */,
    2.43  				B740B7571E4B1B80002585E1 /* MimeTypes */,
    2.44  				43306EBC1FE125950045DD00 /* OAuth2 */,
    2.45 @@ -2012,6 +2009,7 @@
    2.46  		43E58EB21CBF8301008AA7A7 /* Models */ = {
    2.47  			isa = PBXGroup;
    2.48  			children = (
    2.49 +				37C3C0E52260C64D003E290C /* Log.swift */,
    2.50  				15F835231F34BE1300FCE887 /* AccountUserInput.swift */,
    2.51  				43CE63C41DE87FB200FAC505 /* Identity+pEp.swift */,
    2.52  				155475632137FD96005A52D0 /* FolderType+Extensions.swift */,
    2.53 @@ -2223,15 +2221,6 @@
    2.54  			path = ..;
    2.55  			sourceTree = "<group>";
    2.56  		};
    2.57 -		B70A3A9022089D3C00EDCE61 /* Log */ = {
    2.58 -			isa = PBXGroup;
    2.59 -			children = (
    2.60 -				B70A3A9122089D5000EDCE61 /* Log+ASL.swift */,
    2.61 -				B70A3A9222089D5000EDCE61 /* Log.swift */,
    2.62 -			);
    2.63 -			path = Log;
    2.64 -			sourceTree = "<group>";
    2.65 -		};
    2.66  		B70D32A5205BCC020094A92A /* ViewModel */ = {
    2.67  			isa = PBXGroup;
    2.68  			children = (
    2.69 @@ -2734,7 +2723,6 @@
    2.70  			files = (
    2.71  				002375D420DCF59D00663961 /* MoveToAccountViewController.swift in Sources */,
    2.72  				496C0EEB20BC4B370009B5B9 /* EmailListViewModel+EmailDisplayDelegate.swift in Sources */,
    2.73 -				B70A3A9422089D5000EDCE61 /* Log.swift in Sources */,
    2.74  				4315E4C3201242BB00F68763 /* OAuth2Type+Extension.swift in Sources */,
    2.75  				4351C2D11F4441190053381F /* houdini_html_u.c in Sources */,
    2.76  				B70A3C401E817CFA0036876F /* FolderViewModel.swift in Sources */,
    2.77 @@ -2906,6 +2894,7 @@
    2.78  				496C0EE720BC2A880009B5B9 /* EmailDisplayDelegate.swift in Sources */,
    2.79  				152A39DD21905C3E00D9F8E4 /* AccountCell.swift in Sources */,
    2.80  				B7DB7FDC221ADDBD003968DA /* UIImageView+Extension.swift in Sources */,
    2.81 +				37C3C0E62260C64D003E290C /* Log.swift in Sources */,
    2.82  				43306EC21FE129840045DD00 /* OAuth2Type.swift in Sources */,
    2.83  				438052871FE3E1B100ACF729 /* OAuth2AuthorizationFactoryProtocol.swift in Sources */,
    2.84  				4356FFE52135448600804089 /* ReplyAllPossibleChecker.swift in Sources */,
    2.85 @@ -2950,7 +2939,6 @@
    2.86  				43A6E0581E57400E005BEE69 /* RatingReEvaluator.swift in Sources */,
    2.87  				49C34AF620E4F649009D11CC /* CellDetailTransition.swift in Sources */,
    2.88  				492EF92A20C18C6C004EAE14 /* DisplayedMessage.swift in Sources */,
    2.89 -				B70A3A9322089D5000EDCE61 /* Log+ASL.swift in Sources */,
    2.90  				49228A5520D4035100A51E9D /* DetailCellSegue.swift in Sources */,
    2.91  				43497B38211C62DE00AC42B0 /* MessageIdentitfying.swift in Sources */,
    2.92  				00FD0CE82102014C00BA0C56 /* PrimarySplitViewcontroller+ScreenComposerProtocol.swift in Sources */,
     3.1 --- a/pEpForiOS/AppDelegate.swift	Fri Apr 12 13:52:08 2019 +0200
     3.2 +++ b/pEpForiOS/AppDelegate.swift	Mon Apr 15 14:29:14 2019 +0200
     3.3 @@ -53,7 +53,7 @@
     3.4  
     3.5      private func setupInitialViewController() -> Bool {
     3.6          guard let appConfig = appConfig else {
     3.7 -            Logger.appDelegateLogger.errorAndCrash("No AppConfig")
     3.8 +            Log.shared.errorAndCrash("No AppConfig")
     3.9              return false
    3.10          }
    3.11          let mainStoryboard: UIStoryboard = UIStoryboard(name: "FolderViews", bundle: nil)
    3.12 @@ -61,7 +61,7 @@
    3.13              let navController = initialNVC.viewControllers.first as? UINavigationController,
    3.14              let rootVC = navController.rootViewController as? FolderTableViewController
    3.15              else {
    3.16 -                Logger.appDelegateLogger.errorAndCrash("Problem initializing UI")
    3.17 +                Log.shared.errorAndCrash("Problem initializing UI")
    3.18                  return false
    3.19          }
    3.20          rootVC.appConfig = appConfig
    3.21 @@ -85,7 +85,7 @@
    3.22      private func stopUsingPepSession() {
    3.23          syncUserActionsAndCleanupbackgroundTaskId =
    3.24              application.beginBackgroundTask(expirationHandler: { [unowned self] in
    3.25 -                Logger.appDelegateLogger.errorAndCrash(
    3.26 +                Log.shared.errorAndCrash(
    3.27                      "syncUserActionsAndCleanupbackgroundTask with ID %{public}@ expired",
    3.28                      self.syncUserActionsAndCleanupbackgroundTaskId as CVarArg)
    3.29                  // We migh want to call some (yet unexisting) emergency shutdown on NetworkService here
    3.30 @@ -104,7 +104,7 @@
    3.31  
    3.32      func kickOffMySelf() {
    3.33          mySelfTaskId = application.beginBackgroundTask(expirationHandler: { [unowned self] in
    3.34 -            Logger.appDelegateLogger.log("mySelfTaskId with ID expired.")
    3.35 +            Log.shared.log("mySelfTaskId with ID expired.")
    3.36              // We migh want to call some (yet unexisting) emergency shutdown on NetworkService here
    3.37              // that brutally shuts down everything.
    3.38              self.application.endBackgroundTask(
    3.39 @@ -133,7 +133,7 @@
    3.40                                           storeURL: nil,
    3.41                                           options: options)
    3.42          } catch {
    3.43 -            Logger.appDelegateLogger.errorAndCrash("Error while Loading DataStack")
    3.44 +            Log.shared.errorAndCrash("Error while Loading DataStack")
    3.45          }
    3.46      }
    3.47  
    3.48 @@ -216,7 +216,7 @@
    3.49      // MARK: - UIApplicationDelegate
    3.50  
    3.51      func applicationDidReceiveMemoryWarning(_ application: UIApplication) {
    3.52 -        Logger.appDelegateLogger.log("applicationDidReceiveMemoryWarning")
    3.53 +        Log.shared.log("applicationDidReceiveMemoryWarning")
    3.54      }
    3.55  
    3.56      func application(
    3.57 @@ -236,7 +236,7 @@
    3.58          let pEpReInitialized = deleteManagementDBIfRequired()
    3.59  
    3.60          setupServices()
    3.61 -        Logger.appDelegateLogger.log("Library url: %{public}@", String(describing: applicationDirectory()))
    3.62 +        Log.shared.log("Library url: %{public}@", String(describing: applicationDirectory()))
    3.63          deleteAllFolders(pEpReInitialized: pEpReInitialized)
    3.64  
    3.65          prepareUserNotifications()
    3.66 @@ -298,7 +298,7 @@
    3.67          completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    3.68          
    3.69          guard let messageModelService = messageModelService else {
    3.70 -            Logger.appDelegateLogger.error("no networkService")
    3.71 +            Log.shared.error("no networkService")
    3.72              return
    3.73          }
    3.74          
     4.1 --- a/pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift	Fri Apr 12 13:52:08 2019 +0200
     4.2 +++ b/pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift	Mon Apr 15 14:29:14 2019 +0200
     4.3 @@ -62,6 +62,6 @@
     4.4      }
     4.5  
     4.6      func parser(_ parser: AXHTMLParser, parseErrorOccurred parseError: Error) {
     4.7 -        Logger.htmlParsingLogger.errorAndCrash("%@", parseError.localizedDescription)
     4.8 +        Log.shared.errorAndCrash("%@", parseError.localizedDescription)
     4.9      }
    4.10  }
     5.1 --- a/pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift	Fri Apr 12 13:52:08 2019 +0200
     5.2 +++ b/pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift	Mon Apr 15 14:29:14 2019 +0200
     5.3 @@ -60,6 +60,6 @@
     5.4      }
     5.5  
     5.6      func parser(_ parser: AXHTMLParser, parseErrorOccurred parseError: Error) {
     5.7 -        Logger.htmlParsingLogger.error("%@", parseError.localizedDescription)
     5.8 +        Log.shared.error("%@", parseError.localizedDescription)
     5.9      }
    5.10  }
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/pEpForiOS/Models/Log.swift	Mon Apr 15 14:29:14 2019 +0200
     6.3 @@ -0,0 +1,18 @@
     6.4 +//
     6.5 +//  Log.swift
     6.6 +//  pEp
     6.7 +//
     6.8 +//  Created by Alejandro Gelos on 12/04/2019.
     6.9 +//  Copyright © 2019 p≡p Security S.A. All rights reserved.
    6.10 +//
    6.11 +
    6.12 +import pEpIOSToolbox
    6.13 +
    6.14 +/// Shared instance of logger.
    6.15 +class Log {
    6.16 +    static let shared = Logger(subsystem: "security.pEp.pEpForiOS", category: "pEpForiOS")
    6.17 +
    6.18 +    /// Init is forbidden. Singleton...
    6.19 +    private init() {}
    6.20 +}
    6.21 +
     7.1 --- a/pEpForiOS/Models/Server+Fetching.swift	Fri Apr 12 13:52:08 2019 +0200
     7.2 +++ b/pEpForiOS/Models/Server+Fetching.swift	Mon Apr 15 14:29:14 2019 +0200
     7.3 @@ -18,7 +18,7 @@
     7.4              var accounts = [Account]()
     7.5              for cdServer in cdServers {
     7.6                  guard let account = cdServer.account?.account() else {
     7.7 -                    Logger.modelLogger.errorAndCrash("No address")
     7.8 +                    Log.shared.errorAndCrash("No address")
     7.9                      continue
    7.10                  }
    7.11                  accounts.append(account)
     8.1 --- a/pEpForiOS/UI/Background/ReevaluateMessageRatingOperation.swift	Fri Apr 12 13:52:08 2019 +0200
     8.2 +++ b/pEpForiOS/UI/Background/ReevaluateMessageRatingOperation.swift	Mon Apr 15 14:29:14 2019 +0200
     8.3 @@ -61,7 +61,7 @@
     8.4              context.saveAndLogErrors()
     8.5              message.pEpRatingInt = Int(newRating.rawValue)
     8.6          } catch let error as NSError {
     8.7 -            Logger.backendLogger.log(error: error)
     8.8 +            Log.shared.log(error: error)
     8.9          }
    8.10      }
    8.11  }
     9.1 --- a/pEpForiOS/UI/Compose/Cells/AccountCell/AccountCell.swift	Fri Apr 12 13:52:08 2019 +0200
     9.2 +++ b/pEpForiOS/UI/Compose/Cells/AccountCell/AccountCell.swift	Mon Apr 15 14:29:14 2019 +0200
     9.3 @@ -31,7 +31,7 @@
     9.4  
     9.5      private func setupPickerView() {
     9.6          guard let viewModel = viewModel else {
     9.7 -            Logger.frontendLogger.errorAndCrash("No VM")
     9.8 +            Log.shared.errorAndCrash("No VM")
     9.9              return
    9.10          }
    9.11          picker = AccountPickerView()
    10.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Fri Apr 12 13:52:08 2019 +0200
    10.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Mon Apr 15 14:29:14 2019 +0200
    10.3 @@ -26,7 +26,7 @@
    10.4  
    10.5      private func setupInitialText() {
    10.6          guard let vm = viewModel else {
    10.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    10.8 +            Log.shared.errorAndCrash("No VM")
    10.9              return
   10.10          }
   10.11          let (text, attrText) = vm.inititalText()
   10.12 @@ -43,7 +43,7 @@
   10.13      // Set cursor and show keyboard
   10.14      override func setFocus() {
   10.15          guard let vm = viewModel else {
   10.16 -            Logger.frontendLogger.errorAndCrash("No VM")
   10.17 +            Log.shared.errorAndCrash("No VM")
   10.18              return
   10.19          }
   10.20          if let rangeStart = textView.position(from: textView.beginningOfDocument,
   10.21 @@ -101,7 +101,7 @@
   10.22                    shouldChangeTextIn range: NSRange,
   10.23                    replacementText text: String) -> Bool {
   10.24          guard let vm = viewModel else {
   10.25 -            Logger.frontendLogger.errorAndCrash("No VM")
   10.26 +            Log.shared.errorAndCrash("No VM")
   10.27              return true
   10.28          }
   10.29         return vm.shouldReplaceText(in: range, of: textView.attributedText, with: text)
    11.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCellViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    11.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCellViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    11.3 @@ -117,7 +117,7 @@
    11.4  extension BodyCellViewModel {
    11.5      public func inline(attachment: Attachment) {
    11.6          guard let image = attachment.image else {
    11.7 -            Logger.frontendLogger.errorAndCrash("No image")
    11.8 +            Log.shared.errorAndCrash("No image")
    11.9              return
   11.10          }
   11.11          attachment.contentDisposition = .inline
   11.12 @@ -125,7 +125,7 @@
   11.13          // performance issues (delay typing).
   11.14          guard let scaledImage = image.resized(newWidth: maxTextattachmentWidth / 2, useAlpha: false)
   11.15              else {
   11.16 -                Logger.frontendLogger.errorAndCrash("Error resizing")
   11.17 +                Log.shared.errorAndCrash("Error resizing")
   11.18                  return
   11.19          }
   11.20          let textAttachment = TextAttachment()
    12.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/NSAttributedString+BodyTextUtils.swift	Fri Apr 12 13:52:08 2019 +0200
    12.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/NSAttributedString+BodyTextUtils.swift	Mon Apr 15 14:29:14 2019 +0200
    12.3 @@ -16,7 +16,7 @@
    12.4      public func assureMaxTextAttachmentImageWidth(_ maxWidth: CGFloat) {
    12.5          for textAttachment in textAttachments() {
    12.6              guard let image = textAttachment.image else {
    12.7 -                Logger.utilLogger.errorAndCrash("No image?")
    12.8 +                Log.shared.errorAndCrash("No image?")
    12.9                  return
   12.10              }
   12.11              if image.size.width > maxWidth {
    13.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextView.swift	Fri Apr 12 13:52:08 2019 +0200
    13.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextView.swift	Mon Apr 15 14:29:14 2019 +0200
    13.3 @@ -48,7 +48,7 @@
    13.4                           shouldChangeTextIn range: NSRange,
    13.5                           replacementText text: String) -> Bool {
    13.6          guard let vm = viewModel else {
    13.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    13.8 +            Log.shared.errorAndCrash("No VM")
    13.9              return true
   13.10          }
   13.11          if vm.isAddressDeliminator(str: text) {
   13.12 @@ -64,7 +64,7 @@
   13.13                      return true
   13.14              }
   13.15              guard let potentiallyReplacedText = textView.text(in: newRange) else {
   13.16 -                Logger.frontendLogger.errorAndCrash("Invalid state")
   13.17 +                Log.shared.errorAndCrash("Invalid state")
   13.18                  return true
   13.19              }
   13.20              // Check if text is Attachment and select it
   13.21 @@ -89,7 +89,7 @@
   13.22                    shouldInteractWith textAttachment: NSTextAttachment,
   13.23                    in characterRange: NSRange) -> Bool {
   13.24          guard let vm = viewModel else {
   13.25 -            Logger.frontendLogger.errorAndCrash("No VM")
   13.26 +            Log.shared.errorAndCrash("No VM")
   13.27              return true
   13.28          }
   13.29          return vm.shouldInteract(with: textAttachment)
    14.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Fri Apr 12 13:52:08 2019 +0200
    14.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Mon Apr 15 14:29:14 2019 +0200
    14.3 @@ -79,7 +79,7 @@
    14.4                        attributes: attributes, context: nil)
    14.5  
    14.6              guard let createe = UIGraphicsGetImageFromCurrentImageContext() else {
    14.7 -                Logger.frontendLogger.errorAndCrash("No img")
    14.8 +                Log.shared.errorAndCrash("No img")
    14.9                  return
   14.10              }
   14.11              UIGraphicsEndImageContext()
    15.1 --- a/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    15.2 +++ b/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    15.3 @@ -19,7 +19,7 @@
    15.4      private var suggestionsChildViewController: SuggestTableViewController?
    15.5      lazy private var mediaAttachmentPickerProvider: MediaAttachmentPickerProvider? = {
    15.6          guard let pickerVm = viewModel?.mediaAttachmentPickerProviderViewModel() else {
    15.7 -            Logger.frontendLogger.errorAndCrash("Invalid state")
    15.8 +            Log.shared.errorAndCrash("Invalid state")
    15.9              return nil
   15.10          }
   15.11          return MediaAttachmentPickerProvider(with: pickerVm)
   15.12 @@ -75,7 +75,7 @@
   15.13                  withIdentifier: SuggestTableViewController.storyboardId)
   15.14                  as? SuggestTableViewController,
   15.15              let suggestView = suggestVc.view else {
   15.16 -                Logger.frontendLogger.errorAndCrash("No VC.")
   15.17 +                Log.shared.errorAndCrash("No VC.")
   15.18                  return
   15.19          }
   15.20          suggestionsChildViewController = suggestVc
   15.21 @@ -111,7 +111,7 @@
   15.22  extension ComposeTableViewController {
   15.23      private func setupPepColorView(for pEpRating: PEPRating, pEpProtected: Bool) {
   15.24          guard let vm = viewModel else {
   15.25 -            Logger.frontendLogger.errorAndCrash("No VM")
   15.26 +            Log.shared.errorAndCrash("No VM")
   15.27              return
   15.28          }
   15.29  
   15.30 @@ -129,7 +129,7 @@
   15.31      /// Shows a menu where user can choose to make a handshake, or toggle force unprotected.
   15.32      @objc func actionHandshakeOrForceUnprotected(gestureRecognizer: UITapGestureRecognizer) {
   15.33          guard let vm = viewModel else {
   15.34 -            Logger.frontendLogger.errorAndCrash("No VM")
   15.35 +            Log.shared.errorAndCrash("No VM")
   15.36              return
   15.37          }
   15.38          let theCanHandshake = vm.state.canHandshake()
   15.39 @@ -284,7 +284,7 @@
   15.40              guard
   15.41                  let nc = segue.destination as? UINavigationController,
   15.42                  let destination = nc.rootViewController as? HandshakeViewController else {
   15.43 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
   15.44 +                    Log.shared.errorAndCrash("Segue issue")
   15.45                      return
   15.46              }
   15.47              destination.appConfig = appConfig
   15.48 @@ -318,7 +318,7 @@
   15.49              }
   15.50              guard let me = self,
   15.51              let picker = me.mediaAttachmentPickerProvider?.imagePicker else {
   15.52 -                Logger.frontendLogger.errorAndCrash("Lost somthing")
   15.53 +                Log.shared.errorAndCrash("Lost somthing")
   15.54                  return
   15.55              }
   15.56              me.present(picker, animated: true)
   15.57 @@ -340,7 +340,7 @@
   15.58      
   15.59      override func numberOfSections(in tableView: UITableView) -> Int {
   15.60          guard let vm = viewModel else {
   15.61 -            Logger.frontendLogger.errorAndCrash("No VM")
   15.62 +            Log.shared.errorAndCrash("No VM")
   15.63              return 0
   15.64          }
   15.65          return vm.sections.count
   15.66 @@ -349,7 +349,7 @@
   15.67      override func tableView(_ tableView: UITableView,
   15.68                              numberOfRowsInSection section: Int) -> Int {
   15.69          guard let vm = viewModel else {
   15.70 -            Logger.frontendLogger.errorAndCrash("No VM")
   15.71 +            Log.shared.errorAndCrash("No VM")
   15.72              return 0
   15.73          }
   15.74          return vm.sections[section].rows.count
   15.75 @@ -358,7 +358,7 @@
   15.76      override func tableView(_ tableView: UITableView,
   15.77                              cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   15.78          guard let cell = setupCellForIndexPath(indexPath, in: tableView) else {
   15.79 -            Logger.frontendLogger.errorAndCrash("No cell")
   15.80 +            Log.shared.errorAndCrash("No cell")
   15.81              return UITableViewCell()
   15.82          }
   15.83          return cell
   15.84 @@ -367,7 +367,7 @@
   15.85      private func setupCellForIndexPath(_ indexPath: IndexPath,
   15.86                                    in tableView: UITableView) -> UITableViewCell? {
   15.87          guard let vm = viewModel else {
   15.88 -            Logger.frontendLogger.errorAndCrash("No VM")
   15.89 +            Log.shared.errorAndCrash("No VM")
   15.90              return UITableViewCell()
   15.91          }
   15.92  
   15.93 @@ -380,7 +380,7 @@
   15.94                      as? RecipientCell,
   15.95                  let rowVm = section.rows[indexPath.row] as? RecipientCellViewModel
   15.96                  else {
   15.97 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
   15.98 +                    Log.shared.errorAndCrash("Invalid state")
   15.99                      return nil
  15.100              }
  15.101              cell.setup(with: rowVm)
  15.102 @@ -393,7 +393,7 @@
  15.103                      as? AccountCell,
  15.104                  let rowVm = section.rows[indexPath.row] as? AccountCellViewModel
  15.105                  else {
  15.106 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  15.107 +                    Log.shared.errorAndCrash("Invalid state")
  15.108                      return nil
  15.109              }
  15.110              cell.setup(with: rowVm)
  15.111 @@ -404,7 +404,7 @@
  15.112                          as? SubjectCell,
  15.113                      let rowVm = section.rows[indexPath.row] as? SubjectCellViewModel
  15.114                      else {
  15.115 -                        Logger.frontendLogger.errorAndCrash("Invalid state")
  15.116 +                        Log.shared.errorAndCrash("Invalid state")
  15.117                      return nil
  15.118              }
  15.119              cell.setup(with: rowVm)
  15.120 @@ -415,7 +415,7 @@
  15.121                      as? BodyCell,
  15.122                  let rowVm = section.rows[indexPath.row] as? BodyCellViewModel
  15.123                  else {
  15.124 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  15.125 +                    Log.shared.errorAndCrash("Invalid state")
  15.126                      return nil
  15.127              }
  15.128              cell.setup(with: rowVm)
  15.129 @@ -426,7 +426,7 @@
  15.130                      as? AttachmentCell,
  15.131                  let rowVm = section.rows[indexPath.row] as? AttachmentViewModel
  15.132                  else {
  15.133 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  15.134 +                    Log.shared.errorAndCrash("Invalid state")
  15.135                      return nil
  15.136              }
  15.137              cell.setup(with: rowVm)
  15.138 @@ -482,7 +482,7 @@
  15.139          let deleteAction = SwipeAction(style: .destructive, title: "Delete") {
  15.140              [weak self] action, indexPath in
  15.141              guard let me = self else {
  15.142 -                Logger.frontendLogger.lostMySelf()
  15.143 +                Log.shared.errorAndCrash("Lost MySelf")
  15.144                  return
  15.145              }
  15.146              me.deleteAction(forCellAt: indexPath)
  15.147 @@ -501,7 +501,7 @@
  15.148              // The last cell is not yet displayed (as we are in "willDisplay ..."), thus async.
  15.149              DispatchQueue.main.async { [weak self] in
  15.150                  guard let me = self else {
  15.151 -                    Logger.frontendLogger.lostMySelf()
  15.152 +                    Log.shared.errorAndCrash("Lost MySelf")
  15.153                      return
  15.154                  }
  15.155                  me.setInitialFocus()
  15.156 @@ -521,7 +521,7 @@
  15.157          }
  15.158          isInitialFocusSet = true
  15.159          guard let vm = viewModel else {
  15.160 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.161 +            Log.shared.errorAndCrash("No VM")
  15.162              return
  15.163          }
  15.164          let idxPath = vm.initialFocus()
  15.165 @@ -535,13 +535,13 @@
  15.166  
  15.167      private func setPreviousFocusAfterPicker() {
  15.168          guard let vm = viewModel else {
  15.169 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.170 +            Log.shared.errorAndCrash("No VM")
  15.171              return
  15.172          }
  15.173          let idxPath = vm.beforePickerFocus()
  15.174          guard let cellToFocus = tableView.cellForRow(at: idxPath)
  15.175              as? TextViewContainingTableViewCell else {
  15.176 -                Logger.frontendLogger.errorAndCrash("Error casting")
  15.177 +                Log.shared.errorAndCrash("Error casting")
  15.178                  return
  15.179          }
  15.180          cellToFocus.setFocus()
  15.181 @@ -549,7 +549,7 @@
  15.182  
  15.183      private func isLastRow(indexPath: IndexPath) -> Bool {
  15.184          guard let vm = viewModel else {
  15.185 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.186 +            Log.shared.errorAndCrash("No VM")
  15.187              return false
  15.188          }
  15.189          let idxLastSection = vm.sections.count - 1
  15.190 @@ -579,14 +579,14 @@
  15.191  
  15.192      private func deleteAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  15.193          guard let vm = viewModel else {
  15.194 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.195 +            Log.shared.errorAndCrash("No VM")
  15.196              return UIAlertAction()
  15.197          }
  15.198          let action: UIAlertAction
  15.199          let text = vm.deleteActionTitle
  15.200          action = ac.action(text, .destructive) {[weak self] in
  15.201              guard let me = self else {
  15.202 -                Logger.frontendLogger.lostMySelf()
  15.203 +                Log.shared.errorAndCrash("Lost MySelf")
  15.204                  return
  15.205              }
  15.206              vm.handleDeleteActionTriggered()
  15.207 @@ -597,14 +597,14 @@
  15.208  
  15.209      private func saveAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  15.210          guard let vm = viewModel else {
  15.211 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.212 +            Log.shared.errorAndCrash("No VM")
  15.213              return UIAlertAction()
  15.214          }
  15.215          let action: UIAlertAction
  15.216          let text = vm.saveActionTitle
  15.217          action = ac.action(text, .default) { [weak self] in
  15.218              guard let me = self else {
  15.219 -                Logger.frontendLogger.lostMySelf()
  15.220 +                Log.shared.errorAndCrash("Lost MySelf")
  15.221                  return
  15.222              }
  15.223              vm.handleSaveActionTriggered()
  15.224 @@ -615,14 +615,14 @@
  15.225  
  15.226      private func keepInOutboxAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  15.227          guard let vm = viewModel else {
  15.228 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.229 +            Log.shared.errorAndCrash("No VM")
  15.230              return UIAlertAction()
  15.231          }
  15.232          let action: UIAlertAction
  15.233          let text = vm.keepInOutboxActionTitle
  15.234          action = ac.action(text, .default) {[weak self] in
  15.235              guard let me = self else {
  15.236 -                Logger.frontendLogger.lostMySelf()
  15.237 +                Log.shared.errorAndCrash("Lost MySelf")
  15.238                  return
  15.239              }
  15.240              me.dismiss()
  15.241 @@ -632,7 +632,7 @@
  15.242  
  15.243      private func cancelAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  15.244          guard let vm = viewModel else {
  15.245 -            Logger.frontendLogger.errorAndCrash("No VM")
  15.246 +            Log.shared.errorAndCrash("No VM")
  15.247              return UIAlertAction()
  15.248          }
  15.249          return ac.action(vm.cancelActionTitle, .cancel)
    16.1 --- a/pEpForiOS/UI/Compose/Util/ComposeUtil.swift	Fri Apr 12 13:52:08 2019 +0200
    16.2 +++ b/pEpForiOS/UI/Compose/Util/ComposeUtil.swift	Mon Apr 15 14:29:14 2019 +0200
    16.3 @@ -36,7 +36,7 @@
    16.4                  result = om.to
    16.5              } else if om.parent.folderType != .sent, let omFrom = om.from {
    16.6                  guard let me = initialFrom(composeMode: composeMode, originalMessage: om) else {
    16.7 -                    Logger.utilLogger.errorAndCrash("No from")
    16.8 +                    Log.shared.errorAndCrash("No from")
    16.9                      return result
   16.10                  }
   16.11                  let origTos = om.to
   16.12 @@ -63,7 +63,7 @@
   16.13                  result = om.cc
   16.14              } else {
   16.15                  guard let me = initialFrom(composeMode: composeMode, originalMessage: om) else {
   16.16 -                    Logger.utilLogger.errorAndCrash("No from")
   16.17 +                    Log.shared.errorAndCrash("No from")
   16.18                      return result
   16.19                  }
   16.20                  let origCcs = om.cc
   16.21 @@ -147,12 +147,12 @@
   16.22          withDataFrom state: ComposeViewModel.ComposeViewModelState) -> Message? {
   16.23          guard let from = state.from,
   16.24              let account = Account.by(address: from.address) else {
   16.25 -                Logger.frontendLogger.errorAndCrash(
   16.26 +                Log.shared.errorAndCrash(
   16.27                      "We have a problem here getting the senders account.")
   16.28                  return nil
   16.29          }
   16.30          guard let f = Folder.by(account: account, folderType: .outbox) else {
   16.31 -            Logger.utilLogger.errorAndCrash("No outbox")
   16.32 +            Log.shared.errorAndCrash("No outbox")
   16.33              return nil
   16.34          }
   16.35  
   16.36 @@ -191,7 +191,7 @@
   16.37                                           accordingTo composeState:
   16.38          ComposeViewModel.ComposeViewModelState) {
   16.39          guard let composeMode = composeState.initData?.composeMode else {
   16.40 -            Logger.utilLogger.errorAndCrash("No init data")
   16.41 +            Log.shared.errorAndCrash("No init data")
   16.42              return
   16.43          }
   16.44          if composeMode == .replyFrom || composeMode == .replyAll,
    17.1 --- a/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    17.2 +++ b/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    17.3 @@ -31,11 +31,11 @@
    17.4              createAttachment(forSecurityScopedResource: url) {
    17.5                  [weak self] (attachment: Attachment?) in
    17.6                  guard let me = self else {
    17.7 -                    Logger.frontendLogger.lostMySelf()
    17.8 +                    Log.shared.errorAndCrash("Lost MySelf")
    17.9                      return
   17.10                  }
   17.11                  guard let safeAttachment = attachment else {
   17.12 -                    Logger.frontendLogger.errorAndCrash("No attachment")
   17.13 +                    Log.shared.errorAndCrash("No attachment")
   17.14                      return
   17.15                  }
   17.16                  GCD.onMain {
   17.17 @@ -63,7 +63,7 @@
   17.18              CFURLStartAccessingSecurityScopedResource(cfUrl)
   17.19              defer { CFURLStopAccessingSecurityScopedResource(cfUrl) }
   17.20              guard  let resourceData = try? Data(contentsOf: resourceUrl)  else {
   17.21 -                Logger.frontendLogger.errorAndCrash("No data for URL.")
   17.22 +                Log.shared.errorAndCrash("No data for URL.")
   17.23                  completion(nil)
   17.24                  return
   17.25              }
    18.1 --- a/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    18.2 +++ b/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    18.3 @@ -48,7 +48,7 @@
    18.4          guard
    18.5              let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage,
    18.6              let url = info[UIImagePickerController.InfoKey.referenceURL] as? URL else {
    18.7 -                Logger.frontendLogger.errorAndCrash("No Data")
    18.8 +                Log.shared.errorAndCrash("No Data")
    18.9                  return
   18.10          }
   18.11  
   18.12 @@ -59,17 +59,17 @@
   18.13  
   18.14      private func createMovieAttchmentAndInformResultDelegate(info: [UIImagePickerController.InfoKey: Any]) {
   18.15          guard let url = info[UIImagePickerController.InfoKey.mediaURL] as? URL else {
   18.16 -            Logger.frontendLogger.errorAndCrash("No URL")
   18.17 +            Log.shared.errorAndCrash("No URL")
   18.18              return
   18.19          }
   18.20  
   18.21          createAttachment(forResource: url) {[weak self] (attachment)  in
   18.22              guard let me = self else {
   18.23 -                Logger.frontendLogger.lostMySelf()
   18.24 +                Log.shared.errorAndCrash("Lost MySelf")
   18.25                  return
   18.26              }
   18.27              guard let att = attachment else {
   18.28 -                Logger.frontendLogger.errorAndCrash("No Attachment")
   18.29 +                Log.shared.errorAndCrash("No Attachment")
   18.30                  return
   18.31              }
   18.32              let result = MediaAttachment(type: .movie, attachment: att)
   18.33 @@ -83,11 +83,11 @@
   18.34                                    completion: @escaping (Attachment?) -> Void) {
   18.35          attachmentFileIOQueue.async { [weak self] in
   18.36              guard let me = self else {
   18.37 -                Logger.frontendLogger.lostMySelf()
   18.38 +                Log.shared.errorAndCrash("Lost MySelf")
   18.39                  return
   18.40              }
   18.41              guard let resourceData = try? Data(contentsOf: resourceUrl) else {
   18.42 -                Logger.frontendLogger.errorAndCrash("Cound not get data for URL")
   18.43 +                Log.shared.errorAndCrash("Cound not get data for URL")
   18.44                  completion(nil)
   18.45                  return
   18.46              }
    19.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Fri Apr 12 13:52:08 2019 +0200
    19.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Mon Apr 15 14:29:14 2019 +0200
    19.3 @@ -163,12 +163,12 @@
    19.4          /// Is sutable for isDraftsOrOutbox || composeMode == .forward only.
    19.5          mutating private func setBodyPotetionallyTakingOverAttachments() {
    19.6              guard let msg = originalMessage else {
    19.7 -                Logger.frontendLogger.errorAndCrash("Inconsitant state")
    19.8 +                Log.shared.errorAndCrash("Inconsitant state")
    19.9                  return
   19.10              }
   19.11  
   19.12              guard isDraftsOrOutbox || composeMode == .forward else {
   19.13 -                Logger.frontendLogger.errorAndCrash("Unsupported mode or message")
   19.14 +                Log.shared.errorAndCrash("Unsupported mode or message")
   19.15                  return
   19.16              }
   19.17              if let html = msg.longMessageFormatted {
   19.18 @@ -220,7 +220,7 @@
   19.19          // Assure the image is set.
   19.20          if attachment.image == nil {
   19.21              guard let safeData = attachment.data else {
   19.22 -                Logger.frontendLogger.errorAndCrash("No data")
   19.23 +                Log.shared.errorAndCrash("No data")
   19.24                  return
   19.25              }
   19.26              attachment.image = UIImage(data: safeData)
    20.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    20.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    20.3 @@ -77,7 +77,7 @@
    20.4          guard
    20.5              let vm = bodySection?.rows.first,
    20.6              let body = indexPath(for: vm) else {
    20.7 -                Logger.frontendLogger.errorAndCrash("No body")
    20.8 +                Log.shared.errorAndCrash("No body")
    20.9                  return IndexPath(row: 0, section: 0)
   20.10          }
   20.11          return body
   20.12 @@ -129,12 +129,12 @@
   20.13  
   20.14      public func handleUserClickedSendButton() {
   20.15          guard let msg = ComposeUtil.messageToSend(withDataFrom: state) else {
   20.16 -            Logger.frontendLogger.warn("No message for sending")
   20.17 +            Log.shared.warn("No message for sending")
   20.18              return
   20.19          }
   20.20          msg.save()
   20.21          guard let data = state.initData else {
   20.22 -            Logger.frontendLogger.errorAndCrash("No data")
   20.23 +            Log.shared.errorAndCrash("No data")
   20.24              return
   20.25          }
   20.26          if data.isDraftsOrOutbox {
   20.27 @@ -152,7 +152,7 @@
   20.28  
   20.29      public func handleRemovedRow(at indexPath: IndexPath) {
   20.30          guard let removeeVM = viewModel(for: indexPath) as? AttachmentViewModel else {
   20.31 -                Logger.frontendLogger.errorAndCrash("Only attachmnets can be removed by the user")
   20.32 +                Log.shared.errorAndCrash("Only attachmnets can be removed by the user")
   20.33                  return
   20.34          }
   20.35          removeNonInlinedAttachment(removeeVM.attachment)
   20.36 @@ -160,7 +160,7 @@
   20.37  
   20.38      private func deleteOriginalMessage() {
   20.39          guard let data = state.initData else {
   20.40 -            Logger.frontendLogger.errorAndCrash("No data")
   20.41 +            Log.shared.errorAndCrash("No data")
   20.42              return
   20.43          }
   20.44          guard let om = data.originalMessage else {
   20.45 @@ -183,7 +183,7 @@
   20.46          for section in sections where section.type == .recipients {
   20.47              for row  in section.rows where row is RecipientCellViewModel {
   20.48                  guard let recipientVM = row as? RecipientCellViewModel else {
   20.49 -                    Logger.frontendLogger.errorAndCrash("Cast error")
   20.50 +                    Log.shared.errorAndCrash("Cast error")
   20.51                      return false
   20.52                  }
   20.53                  if recipientVM.isDirty {
   20.54 @@ -362,14 +362,14 @@
   20.55  extension ComposeViewModel {
   20.56      private func removeNonInlinedAttachment(_ removee: Attachment) {
   20.57          guard let section = section(for: .attachments) else {
   20.58 -            Logger.frontendLogger.errorAndCrash("Only attachmnets can be removed by the user")
   20.59 +            Log.shared.errorAndCrash("Only attachmnets can be removed by the user")
   20.60              return
   20.61          }
   20.62          // Remove from section
   20.63          var newAttachmentVMs = [AttachmentViewModel]()
   20.64          for vm in section.rows {
   20.65              guard let aVM = vm as? AttachmentViewModel else {
   20.66 -                Logger.frontendLogger.errorAndCrash("Error casting")
   20.67 +                Log.shared.errorAndCrash("Error casting")
   20.68                  return
   20.69              }
   20.70              if aVM.attachment != removee {
   20.71 @@ -395,7 +395,7 @@
   20.72              existing.rows.append(AttachmentViewModel(attachment: att))
   20.73          } else {
   20.74              guard let new = Section(type: .attachments, for: state, cellVmDelegate: self) else {
   20.75 -                Logger.frontendLogger.errorAndCrash("Invalid state")
   20.76 +                Log.shared.errorAndCrash("Invalid state")
   20.77                  return
   20.78              }
   20.79              sections.append(new)
   20.80 @@ -422,7 +422,7 @@
   20.81              let idxPath = lastRowWithSuggestions,
   20.82              let recipientVM = sections[idxPath.section].rows[idxPath.row] as? RecipientCellViewModel
   20.83              else {
   20.84 -                Logger.frontendLogger.errorAndCrash("No row VM")
   20.85 +                Log.shared.errorAndCrash("No row VM")
   20.86              return
   20.87          }
   20.88          recipientVM.add(recipient: identity)
   20.89 @@ -473,7 +473,7 @@
   20.90          didSelect mediaAttachment: MediaAttachmentPickerProviderViewModel.MediaAttachment) {
   20.91          if mediaAttachment.type == .image {
   20.92              guard let bodyViewModel = bodyVM else {
   20.93 -                Logger.frontendLogger.errorAndCrash("No bodyVM. Maybe valid as picking is async.")
   20.94 +                Log.shared.errorAndCrash("No bodyVM. Maybe valid as picking is async.")
   20.95                  return
   20.96              }
   20.97              bodyViewModel.inline(attachment: mediaAttachment.attachment)
   20.98 @@ -498,7 +498,7 @@
   20.99  
  20.100      public var deleteActionTitle: String {
  20.101          guard let data = state.initData else {
  20.102 -            Logger.frontendLogger.errorAndCrash("No data")
  20.103 +            Log.shared.errorAndCrash("No data")
  20.104              return ""
  20.105          }
  20.106          let title: String
  20.107 @@ -517,7 +517,7 @@
  20.108  
  20.109      public var saveActionTitle: String {
  20.110          guard let data = state.initData else {
  20.111 -            Logger.frontendLogger.errorAndCrash("No data")
  20.112 +            Log.shared.errorAndCrash("No data")
  20.113              return ""
  20.114          }
  20.115          let title: String
  20.116 @@ -541,7 +541,7 @@
  20.117  
  20.118      public func handleDeleteActionTriggered() {
  20.119          guard let data = state.initData else {
  20.120 -            Logger.frontendLogger.errorAndCrash("No data")
  20.121 +            Log.shared.errorAndCrash("No data")
  20.122              return
  20.123          }
  20.124          if data.isOutbox {
  20.125 @@ -552,7 +552,7 @@
  20.126  
  20.127      public func handleSaveActionTriggered() {
  20.128          guard let data = state.initData else {
  20.129 -            Logger.frontendLogger.errorAndCrash("No data")
  20.130 +            Log.shared.errorAndCrash("No data")
  20.131              return
  20.132          }
  20.133          if data.isDraftsOrOutbox {
  20.134 @@ -568,12 +568,12 @@
  20.135          }
  20.136  
  20.137          guard let msg = ComposeUtil.messageToSend(withDataFrom: state) else {
  20.138 -            Logger.frontendLogger.errorAndCrash("No message")
  20.139 +            Log.shared.errorAndCrash("No message")
  20.140              return
  20.141          }
  20.142          let acc = msg.parent.account
  20.143          guard let f = Folder.by(account:acc, folderType: .drafts) else {
  20.144 -            Logger.frontendLogger.errorAndCrash("No drafts")
  20.145 +            Log.shared.errorAndCrash("No drafts")
  20.146              return
  20.147          }
  20.148          msg.parent = f
  20.149 @@ -617,7 +617,7 @@
  20.150  
  20.151      func recipientCellViewModel(_ vm: RecipientCellViewModel, didBeginEditing text: String) {
  20.152          guard let idxPath = indexPath(for: vm) else {
  20.153 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  20.154 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  20.155              return
  20.156          }
  20.157          lastRowWithSuggestions = idxPath
  20.158 @@ -633,7 +633,7 @@
  20.159  
  20.160      func recipientCellViewModel(_ vm: RecipientCellViewModel, textChanged newText: String) {
  20.161          guard let idxPath = indexPath(for: vm) else {
  20.162 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  20.163 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  20.164              return
  20.165          }
  20.166          lastRowWithSuggestions = idxPath
  20.167 @@ -650,7 +650,7 @@
  20.168  extension ComposeViewModel: AccountCellViewModelResultDelegate {
  20.169      func accountCellViewModel(_ vm: AccountCellViewModel, accountChangedTo account: Account) {
  20.170          guard let idxPath = indexPath(for: vm) else {
  20.171 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  20.172 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  20.173              return
  20.174          }
  20.175          state.from = account.user
  20.176 @@ -664,7 +664,7 @@
  20.177  
  20.178      func subjectCellViewModelDidChangeSubject(_ vm: SubjectCellViewModel) {
  20.179          guard let idxPath = indexPath(for: vm) else {
  20.180 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  20.181 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  20.182              return
  20.183          }
  20.184          state.subject = vm.content ?? ""
  20.185 @@ -703,7 +703,7 @@
  20.186          state.bodyHtml = html
  20.187          state.bodyPlaintext = plain
  20.188          guard let idxPath = indexPath(for: vm) else {
  20.189 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  20.190 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  20.191              return
  20.192          }
  20.193          delegate?.contentChanged(inRowAt: idxPath)
    21.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModelState.swift	Fri Apr 12 13:52:08 2019 +0200
    21.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModelState.swift	Mon Apr 15 14:29:14 2019 +0200
    21.3 @@ -124,7 +124,7 @@
    21.4  
    21.5          private func setup() {
    21.6              guard let initData = initData else {
    21.7 -                Logger.frontendLogger.errorAndCrash("No data")
    21.8 +                Log.shared.errorAndCrash("No data")
    21.9                  return
   21.10              }
   21.11              toRecipients = initData.toRecipients
    22.1 --- a/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Fri Apr 12 13:52:08 2019 +0200
    22.2 +++ b/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Mon Apr 15 14:29:14 2019 +0200
    22.3 @@ -21,7 +21,7 @@
    22.4  
    22.5      override func main() {
    22.6          guard let data = attachment.data else {
    22.7 -            Logger.backendLogger.warn("Attachment without data")
    22.8 +            Log.shared.warn("Attachment without data")
    22.9              return
   22.10          }
   22.11          var tmpDirURL: URL?
   22.12 @@ -44,7 +44,7 @@
   22.13              try data.write(to: theURL)
   22.14              fileURL = theURL
   22.15          } catch {
   22.16 -            Logger.backendLogger.log(error: error)
   22.17 +            Log.shared.log(error: error)
   22.18          }
   22.19      }
   22.20  }
    23.1 --- a/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    23.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    23.3 @@ -186,7 +186,7 @@
    23.4      // Sets the destructive bottom bar item accordint to the message (trash/archive)
    23.5      private func setupDestructiveButtonIcon() {
    23.6          guard let msg = message else {
    23.7 -            Logger.frontendLogger.errorAndCrash("No message")
    23.8 +            Log.shared.errorAndCrash("No message")
    23.9              return
   23.10          }
   23.11  
   23.12 @@ -236,7 +236,7 @@
   23.13              storyboard.instantiateViewController(withIdentifier: SecureWebViewController.storyboardId)
   23.14                  as? SecureWebViewController
   23.15              else {
   23.16 -                Logger.frontendLogger.errorAndCrash("Cast error")
   23.17 +                Log.shared.errorAndCrash("Cast error")
   23.18                  return SecureWebViewController()
   23.19          }
   23.20          vc.zoomingEnabled = true
   23.21 @@ -267,7 +267,7 @@
   23.22  
   23.23      private func setup(contentCell: MessageContentCell, rowData: ComposeFieldModel) {
   23.24          guard let m = message else {
   23.25 -            Logger.frontendLogger.errorAndCrash("No msg.")
   23.26 +            Log.shared.errorAndCrash("No msg.")
   23.27              return
   23.28          }
   23.29          if let htmlBody = htmlBody(message: m) {
   23.30 @@ -329,7 +329,7 @@
   23.31              message = m
   23.32          }
   23.33  
   23.34 -        Logger.frontendLogger.log("next, will reload table view")
   23.35 +        Log.shared.log("next, will reload table view")
   23.36          configureTableRows()
   23.37          tableView.reloadData()
   23.38          configureView()
   23.39 @@ -341,7 +341,7 @@
   23.40              message = m
   23.41          }
   23.42  
   23.43 -        Logger.frontendLogger.log("previous, will reload table view")
   23.44 +        Log.shared.log("previous, will reload table view")
   23.45          configureTableRows()
   23.46          tableView.reloadData()
   23.47          configureView()
   23.48 @@ -353,19 +353,19 @@
   23.49          let alert = ReplyAlertCreator(replyAllChecker: ReplyAllPossibleChecker())
   23.50              .withReplyOption { [weak self] action in
   23.51                  guard let me = self else {
   23.52 -                    Logger.frontendLogger.lostMySelf()
   23.53 +                    Log.shared.errorAndCrash("Lost MySelf")
   23.54                      return
   23.55                  }
   23.56                  me.performSegue(withIdentifier: .segueReplyFrom , sender: self)
   23.57              }.withReplyAllOption(forMessage: message) { [weak self] action in
   23.58                  guard let me = self else {
   23.59 -                    Logger.frontendLogger.lostMySelf()
   23.60 +                    Log.shared.errorAndCrash("Lost MySelf")
   23.61                      return
   23.62                  }
   23.63                  me.performSegue(withIdentifier: .segueReplyAllForm , sender: self)
   23.64              }.withFordwardOption { [weak self] action in
   23.65                  guard let me = self else {
   23.66 -                    Logger.frontendLogger.lostMySelf()
   23.67 +                    Log.shared.errorAndCrash("Lost MySelf")
   23.68                      return
   23.69                  }
   23.70                  me.performSegue(withIdentifier: .segueForward , sender: self)
   23.71 @@ -463,7 +463,7 @@
   23.72  
   23.73      override func tableView(
   23.74          _ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   23.75 -        Logger.frontendLogger.log("cell for %d:%d", indexPath.section, indexPath.row)
   23.76 +        Log.shared.log("cell for %d:%d", indexPath.section, indexPath.row)
   23.77          guard
   23.78              let row = tableData?.getRow(at: indexPath.row),
   23.79              let cell = tableView.dequeueReusableCell(
   23.80 @@ -485,7 +485,7 @@
   23.81          _ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
   23.82          guard
   23.83              let row = tableData?.getRow(at: indexPath.row) else {
   23.84 -                Logger.frontendLogger.errorAndCrash("Missing data")
   23.85 +                Log.shared.errorAndCrash("Missing data")
   23.86                  return tableView.estimatedRowHeight
   23.87          }
   23.88  
   23.89 @@ -525,7 +525,7 @@
   23.90          case .segueReplyFrom, .segueReplyAllForm, .segueForward:
   23.91              guard  let nav = segue.destination as? UINavigationController,
   23.92                  let destination = nav.topViewController as? ComposeTableViewController else {
   23.93 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   23.94 +                    Log.shared.errorAndCrash("No DVC?")
   23.95                      break
   23.96              }
   23.97              destination.appConfig = appConfig
   23.98 @@ -536,7 +536,7 @@
   23.99          case .segueShowMoveToFolder:
  23.100              guard  let nav = segue.destination as? UINavigationController,
  23.101                  let destination = nav.topViewController as? MoveToAccountViewController else {
  23.102 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
  23.103 +                    Log.shared.errorAndCrash("No DVC?")
  23.104                      break
  23.105              }
  23.106              destination.appConfig = appConfig
  23.107 @@ -549,7 +549,7 @@
  23.108              guard let nv = segue.destination as? UINavigationController,
  23.109                  let vc = nv.topViewController as? HandshakeViewController,
  23.110                  let titleView = navigationItem.titleView else {
  23.111 -                Logger.frontendLogger.errorAndCrash("No DVC?")
  23.112 +                Log.shared.errorAndCrash("No DVC?")
  23.113                  break
  23.114              }
  23.115  
  23.116 @@ -576,7 +576,7 @@
  23.117          } else if segueId == .segueForward {
  23.118              return  .forward
  23.119          } else {
  23.120 -            Logger.frontendLogger.errorAndCrash("Unsupported input")
  23.121 +            Log.shared.errorAndCrash("Unsupported input")
  23.122              return .replyFrom
  23.123          }
  23.124      }
    24.1 --- a/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Fri Apr 12 13:52:08 2019 +0200
    24.2 +++ b/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Mon Apr 15 14:29:14 2019 +0200
    24.3 @@ -40,12 +40,12 @@
    24.4          } else {
    24.5              filterRows(filter: { $0.type != .mailingList} )
    24.6          }
    24.7 -        Logger.frontendLogger.log("filtering rows")
    24.8 +        Log.shared.log("filtering rows")
    24.9      }
   24.10  
   24.11      func numberOfRows() -> Int {
   24.12          let visibleRows = getVisibleRows()
   24.13 -        Logger.frontendLogger.log("number of rows -> %d", visibleRows.count)
   24.14 +        Log.shared.log("number of rows -> %d", visibleRows.count)
   24.15          return visibleRows.count
   24.16      }
   24.17  
   24.18 @@ -74,7 +74,7 @@
   24.19  
   24.20          subscript(index: Int) -> Row? {
   24.21              if index < 0 || index > (attachments.count - 1) {
   24.22 -                Logger.frontendLogger.errorAndCrash("Index out of bounds")
   24.23 +                Log.shared.errorAndCrash("Index out of bounds")
   24.24                  return nil
   24.25              }
   24.26              let attachment = attachments[index]
   24.27 @@ -115,7 +115,7 @@
   24.28  
   24.29          mutating func remove(at index: Int) {
   24.30              if index < 0 || index > (attachments.count - 1) {
   24.31 -                Logger.frontendLogger.errorAndCrash("Index out of bounds")
   24.32 +                Log.shared.errorAndCrash("Index out of bounds")
   24.33                  return
   24.34              }
   24.35              attachments.remove(at: index)
    25.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    25.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    25.3 @@ -202,7 +202,7 @@
    25.4          }
    25.5          if splitViewController.isCollapsed {
    25.6              guard let vm = model else {
    25.7 -                Logger.frontendLogger.errorAndCrash("Invalid state")
    25.8 +                Log.shared.errorAndCrash("Invalid state")
    25.9                  return
   25.10              }
   25.11              let unreadFilterActive = vm.unreadFilterEnabled()
   25.12 @@ -422,7 +422,7 @@
   25.13      
   25.14      @IBAction func filterButtonHasBeenPressed(_ sender: UIBarButtonItem) {
   25.15          guard let vm = model else {
   25.16 -            Logger.frontendLogger.errorAndCrash("We should have a model here")
   25.17 +            Log.shared.errorAndCrash("We should have a model here")
   25.18              return
   25.19          }
   25.20          vm.isFilterEnabled = !vm.isFilterEnabled
   25.21 @@ -443,7 +443,7 @@
   25.22  
   25.23      private func updateFilterButtonView() {
   25.24          guard let vm = model else {
   25.25 -            Logger.frontendLogger.errorAndCrash("We should have a model here")
   25.26 +            Log.shared.errorAndCrash("We should have a model here")
   25.27              return
   25.28          }
   25.29  
   25.30 @@ -489,7 +489,7 @@
   25.31              }
   25.32              theCell.configure(for:viewModel)
   25.33          } else {
   25.34 -            Logger.frontendLogger.errorAndCrash("dequeued wrong cell")
   25.35 +            Log.shared.errorAndCrash("dequeued wrong cell")
   25.36          }
   25.37  
   25.38          return cell
   25.39 @@ -509,7 +509,7 @@
   25.40          var swipeActions = [SwipeAction]()
   25.41  
   25.42          guard let model = model else {
   25.43 -            Logger.frontendLogger.errorAndCrash("Should have VM")
   25.44 +            Log.shared.errorAndCrash("Should have VM")
   25.45              return nil
   25.46          }
   25.47  
   25.48 @@ -520,7 +520,7 @@
   25.49                          title: destructiveAction.title(forDisplayMode: .titleAndImage)) {
   25.50                  [weak self] action, indexPath in
   25.51                  guard let me = self else {
   25.52 -                    Logger.frontendLogger.lostMySelf()
   25.53 +                    Log.shared.errorAndCrash("Lost MySelf")
   25.54                      return
   25.55                  }
   25.56  
   25.57 @@ -536,7 +536,7 @@
   25.58              let flagAction = SwipeAction(style: .default, title: "Flag") {
   25.59                  [weak self] action, indexPath in
   25.60                  guard let me = self else {
   25.61 -                    Logger.frontendLogger.lostMySelf()
   25.62 +                    Log.shared.errorAndCrash("Lost MySelf")
   25.63                      return
   25.64                  }
   25.65                  me.flagAction(forCellAt: indexPath)
   25.66 @@ -556,7 +556,7 @@
   25.67              let moreAction = SwipeAction(style: .default, title: "More") {
   25.68                  [weak self] action, indexPath in
   25.69                  guard let me = self else {
   25.70 -                    Logger.frontendLogger.lostMySelf()
   25.71 +                    Log.shared.errorAndCrash("Lost MySelf")
   25.72                      return
   25.73                  }
   25.74                  me.moreAction(forCellAt: indexPath)
   25.75 @@ -592,7 +592,7 @@
   25.76              }
   25.77          } else {
   25.78              guard let model = model else {
   25.79 -                Logger.frontendLogger.errorAndCrash("No folder")
   25.80 +                Log.shared.errorAndCrash("No folder")
   25.81                  return
   25.82              }
   25.83              lastSelectedIndexPath = indexPath
   25.84 @@ -620,7 +620,7 @@
   25.85      override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell,
   25.86                              forRowAt indexPath: IndexPath) {
   25.87          guard let vm = model else {
   25.88 -            Logger.frontendLogger.errorAndCrash("No model.")
   25.89 +            Log.shared.errorAndCrash("No model.")
   25.90              return
   25.91          }
   25.92          vm.fetchOlderMessagesIfRequired(forIndexPath: indexPath)
   25.93 @@ -663,7 +663,7 @@
   25.94  
   25.95      func didDismissSearchController(_ searchController: UISearchController) {
   25.96          guard let vm = model else {
   25.97 -            Logger.frontendLogger.errorAndCrash("No chance to remove filter, sorry.")
   25.98 +            Log.shared.errorAndCrash("No chance to remove filter, sorry.")
   25.99              return
  25.100          }
  25.101          vm.removeSearchFilter()
  25.102 @@ -687,7 +687,7 @@
  25.103                  storyboard.instantiateViewController(withIdentifier: "threadViewController")
  25.104                      as? ThreadViewController
  25.105                  else {
  25.106 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  25.107 +                    Log.shared.errorAndCrash("Segue issue")
  25.108                      return
  25.109              }
  25.110  
  25.111 @@ -783,7 +783,7 @@
  25.112      func emailListViewModel(viewModel: EmailListViewModel,
  25.113                              didChangeSeenStateForDataAt indexPaths: [IndexPath]) {
  25.114          guard let isIphone = splitViewController?.isCollapsed, let vm = model else {
  25.115 -            Logger.frontendLogger.errorAndCrash("Invalid state")
  25.116 +            Log.shared.errorAndCrash("Invalid state")
  25.117              return
  25.118          }
  25.119  
  25.120 @@ -861,7 +861,7 @@
  25.121          let title = NSLocalizedString("Move to Folder", comment: "EmailList action title")
  25.122          return UIAlertAction(title: title, style: .default) { [weak self] action in
  25.123              guard let me = self else {
  25.124 -                Logger.frontendLogger.lostMySelf()
  25.125 +                Log.shared.errorAndCrash("Lost MySelf")
  25.126                  return
  25.127              }
  25.128              me.performSegue(withIdentifier: .segueShowMoveToFolder, sender: me)
  25.129 @@ -873,7 +873,7 @@
  25.130          return  UIAlertAction(title: title, style: .cancel) {
  25.131              [weak self] action in
  25.132              guard let me = self else {
  25.133 -                Logger.frontendLogger.lostMySelf()
  25.134 +                Log.shared.errorAndCrash("Lost MySelf")
  25.135                  return
  25.136              }
  25.137              me.tableView.beginUpdates()
  25.138 @@ -887,7 +887,7 @@
  25.139          return UIAlertAction(title: title, style: .default) {
  25.140              [weak self] action in
  25.141              guard let me = self else {
  25.142 -                Logger.frontendLogger.lostMySelf()
  25.143 +                Log.shared.errorAndCrash("Lost MySelf")
  25.144                  return
  25.145              }
  25.146              me.performSegue(withIdentifier: .segueReply, sender: me)
  25.147 @@ -900,7 +900,7 @@
  25.148              return UIAlertAction(title: title, style: .default) {
  25.149                  [weak self] action in
  25.150                  guard let me = self else {
  25.151 -                    Logger.frontendLogger.lostMySelf()
  25.152 +                    Log.shared.errorAndCrash("Lost MySelf")
  25.153                      return
  25.154                  }
  25.155                  me.performSegue(withIdentifier: .segueReplyAll, sender: me)
  25.156 @@ -915,7 +915,7 @@
  25.157          return UIAlertAction(title: title, style: .default) {
  25.158              [weak self] action in
  25.159              guard let me = self else {
  25.160 -                Logger.frontendLogger.lostMySelf()
  25.161 +                Log.shared.errorAndCrash("Lost MySelf")
  25.162                  return
  25.163              }
  25.164              me.performSegue(withIdentifier: .segueForward, sender: me)
  25.165 @@ -939,11 +939,11 @@
  25.166  
  25.167      func flagAction(forCellAt indexPath: IndexPath) {
  25.168          guard let row = model?.viewModel(for: indexPath.row) else {
  25.169 -            Logger.frontendLogger.errorAndCrash("No data for indexPath!")
  25.170 +            Log.shared.errorAndCrash("No data for indexPath!")
  25.171              return
  25.172          }
  25.173          guard let cell = self.tableView.cellForRow(at: indexPath) as? EmailListViewCell else {
  25.174 -            Logger.frontendLogger.errorAndCrash("No cell for indexPath!")
  25.175 +            Log.shared.errorAndCrash("No cell for indexPath!")
  25.176              return
  25.177          }
  25.178          if row.isFlagged {
  25.179 @@ -1013,7 +1013,7 @@
  25.180                  let vc = nav.rootViewController as? EmailViewController,
  25.181                  let indexPath = lastSelectedIndexPath,
  25.182                  let message = model?.message(representedByRowAt: indexPath) else {
  25.183 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  25.184 +                    Log.shared.errorAndCrash("Segue issue")
  25.185                      return
  25.186              }
  25.187              vc.appConfig = appConfig
  25.188 @@ -1030,7 +1030,7 @@
  25.189                      return
  25.190              }
  25.191              guard let message = model?.message(representedByRowAt: indexPath) else {
  25.192 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  25.193 +                Log.shared.errorAndCrash("Segue issue")
  25.194                  return
  25.195              }
  25.196              vc.appConfig = appConfig
  25.197 @@ -1041,7 +1041,7 @@
  25.198              model?.updateThreadListDelegate = viewModel*/
  25.199          case .segueShowFilter:
  25.200              guard let destiny = segue.destination as? FilterTableViewController  else {
  25.201 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  25.202 +                Log.shared.errorAndCrash("Segue issue")
  25.203                  return
  25.204              }
  25.205              destiny.appConfig = appConfig
  25.206 @@ -1053,7 +1053,7 @@
  25.207              guard
  25.208                  let nav = segue.destination as? UINavigationController,
  25.209                  let vc = nav.rootViewController as? LoginViewController else {
  25.210 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  25.211 +                    Log.shared.errorAndCrash("Segue issue")
  25.212                      return
  25.213              }
  25.214              vc.appConfig = appConfig
  25.215 @@ -1062,7 +1062,7 @@
  25.216              break
  25.217          case .segueFolderViews:
  25.218              guard let vC = segue.destination as? FolderTableViewController  else {
  25.219 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  25.220 +                Log.shared.errorAndCrash("Segue issue")
  25.221                  return
  25.222              }
  25.223              vC.appConfig = appConfig
  25.224 @@ -1080,7 +1080,7 @@
  25.225              guard  let nav = segue.destination as? UINavigationController,
  25.226                  let destination = nav.topViewController as? MoveToAccountViewController
  25.227                  else {
  25.228 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
  25.229 +                    Log.shared.errorAndCrash("No DVC?")
  25.230                      break
  25.231              }
  25.232  
  25.233 @@ -1093,7 +1093,7 @@
  25.234              //No initialization needed
  25.235              break
  25.236          default:
  25.237 -            Logger.frontendLogger.errorAndCrash("Unhandled segue")
  25.238 +            Log.shared.errorAndCrash("Unhandled segue")
  25.239              break
  25.240          }
  25.241      }
  25.242 @@ -1109,7 +1109,7 @@
  25.243              let composeVc = nav.topViewController as? ComposeTableViewController,
  25.244              let composeMode = composeMode(for: segueId),
  25.245              let vm = model else {
  25.246 -                Logger.frontendLogger.errorAndCrash("composeViewController setup issue")
  25.247 +                Log.shared.errorAndCrash("composeViewController setup issue")
  25.248                  return
  25.249          }
  25.250          composeVc.appConfig = appConfig
  25.251 @@ -1118,7 +1118,7 @@
  25.252              // This is not a simple compose (but reply, forward or such),
  25.253              // thus we have to pass the original message.
  25.254              guard let indexPath = lastSelectedIndexPath else {
  25.255 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  25.256 +                    Log.shared.errorAndCrash("Invalid state")
  25.257                      return
  25.258              }
  25.259  
    26.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift	Fri Apr 12 13:52:08 2019 +0200
    26.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift	Mon Apr 15 14:29:14 2019 +0200
    26.3 @@ -23,7 +23,7 @@
    26.4  
    26.5          MessageModelUtil.performAndWait { [weak self] in
    26.6              guard let me = self else {
    26.7 -                Logger.frontendLogger.lostMySelf()
    26.8 +                Log.shared.errorAndCrash("Lost MySelf")
    26.9                  return
   26.10              }
   26.11              me.didDelete(message: message)
    27.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift	Fri Apr 12 13:52:08 2019 +0200
    27.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift	Mon Apr 15 14:29:14 2019 +0200
    27.3 @@ -17,7 +17,7 @@
    27.4      func didCreate(message: Message) {
    27.5          DispatchQueue.main.async { [weak self] in
    27.6              guard let me = self else {
    27.7 -                Logger.frontendLogger.lostMySelf()
    27.8 +                Log.shared.errorAndCrash("Lost MySelf")
    27.9                  return
   27.10              }
   27.11              me.didCreateInternal(message: message)
   27.12 @@ -27,7 +27,7 @@
   27.13      func didUpdate(message: Message) {
   27.14          DispatchQueue.main.async { [weak self] in
   27.15              guard let me = self else {
   27.16 -                Logger.frontendLogger.lostMySelf()
   27.17 +                Log.shared.errorAndCrash("Lost MySelf")
   27.18                  return
   27.19              }
   27.20              me.didUpdateInternal(message: message)
   27.21 @@ -37,7 +37,7 @@
   27.22      func didDelete(message: Message) {
   27.23          DispatchQueue.main.async { [weak self] in
   27.24              guard let me = self else {
   27.25 -                Logger.frontendLogger.lostMySelf()
   27.26 +                Log.shared.errorAndCrash("Lost MySelf")
   27.27                  return
   27.28              }
   27.29              me.didDeleteInternal(message: message)
   27.30 @@ -140,7 +140,7 @@
   27.31  
   27.32          // We do have this message in our (top message) model, so we do have to update it
   27.33          guard let existingMessage = messages.object(at: indexExisting) else {
   27.34 -            Logger.frontendLogger.errorAndCrash(
   27.35 +            Log.shared.errorAndCrash(
   27.36                  "We should have the message at this point")
   27.37              return
   27.38          }
   27.39 @@ -193,7 +193,7 @@
   27.40          // The updated message has to be shown. Add it to the model ...
   27.41          let indexInserted = me.messages.insert(object: previewMessage)
   27.42          if indexExisting != indexInserted {
   27.43 -            Logger.frontendLogger.warn(
   27.44 +            Log.shared.warn(
   27.45                  "When updating a message, the the new index of the message must be the same as the old index. Something is fishy here."
   27.46              )
   27.47          }
    28.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    28.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    28.3 @@ -165,7 +165,7 @@
    28.4  
    28.5      func viewModel(for index: Int) -> MessageViewModel? {
    28.6          guard let messageViewModel = messages.object(at: index) else {
    28.7 -            Logger.frontendLogger.errorAndCrash("InconsistencyviewModel vs. model")
    28.8 +            Log.shared.errorAndCrash("InconsistencyviewModel vs. model")
    28.9              return nil
   28.10          }
   28.11          return messageViewModel
   28.12 @@ -283,7 +283,7 @@
   28.13  
   28.14          for pvm in deletees {
   28.15              guard let message = pvm.message() else {
   28.16 -                Logger.frontendLogger.errorAndCrash("No mesage")
   28.17 +                Log.shared.errorAndCrash("No mesage")
   28.18                  return
   28.19              }
   28.20              delete(message: message)
   28.21 @@ -334,7 +334,7 @@
   28.22  
   28.23      func delete(forIndexPath indexPath: IndexPath) {
   28.24          guard let deletedMessage = deleteMessage(at: indexPath) else {
   28.25 -            Logger.frontendLogger.errorAndCrash(
   28.26 +            Log.shared.errorAndCrash(
   28.27                  "Not sure if this is a valid case. Remove this log if so.")
   28.28              return
   28.29          }
   28.30 @@ -442,7 +442,7 @@
   28.31          if folderToShow is UnifiedInbox {
   28.32              // folderToShow is unified inbox, fetch parent folder from DB.
   28.33              guard let folder = messages.object(at: index)?.message()?.parent else {
   28.34 -                    Logger.frontendLogger.errorAndCrash("Dangling Message")
   28.35 +                    Log.shared.errorAndCrash("Dangling Message")
   28.36                      return folderToShow
   28.37              }
   28.38              parentFolder = folder
   28.39 @@ -555,7 +555,7 @@
   28.40  
   28.41      public func removeSearchFilter() {
   28.42          guard let filter = folderToShow.filter else {
   28.43 -            Logger.frontendLogger.errorAndCrash("No folder.")
   28.44 +            Log.shared.errorAndCrash("No folder.")
   28.45              return
   28.46          }
   28.47          let filtersChanged = filter.removeSearchFilter()
   28.48 @@ -570,7 +570,7 @@
   28.49          }
   28.50  
   28.51          guard let folderFilter = folderToShow.filter else {
   28.52 -            Logger.frontendLogger.errorAndCrash("We just set the filter but do not have one?")
   28.53 +            Log.shared.errorAndCrash("We just set the filter but do not have one?")
   28.54              return CompositeFilter<FilterBase>.defaultFilter()
   28.55          }
   28.56          return folderFilter
   28.57 @@ -580,7 +580,7 @@
   28.58  
   28.59      func folderIsDraft(_ parentFolder: Folder?) -> Bool {
   28.60          guard let folder = parentFolder else {
   28.61 -            Logger.frontendLogger.errorAndCrash("No parent.")
   28.62 +            Log.shared.errorAndCrash("No parent.")
   28.63              return false
   28.64          }
   28.65          return folder.folderType == .drafts
   28.66 @@ -588,7 +588,7 @@
   28.67  
   28.68      func folderIsOutbox(_ parentFolder: Folder?) -> Bool {
   28.69          guard let folder = parentFolder else {
   28.70 -            Logger.frontendLogger.errorAndCrash("No parent.")
   28.71 +            Log.shared.errorAndCrash("No parent.")
   28.72              return false
   28.73          }
   28.74          return folder.folderType == .outbox
    29.1 --- a/pEpForiOS/UI/Filter/ViewModel/FilterViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    29.2 +++ b/pEpForiOS/UI/Filter/ViewModel/FilterViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    29.3 @@ -46,7 +46,7 @@
    29.4          case .accouts:
    29.5              for account in Account.all() {
    29.6                  guard let icon = UIImage(named: "folders-icon-inbox") else {
    29.7 -                    Logger.frontendLogger.errorAndCrash("Error Loading images")
    29.8 +                    Log.shared.errorAndCrash("Error Loading images")
    29.9                      return
   29.10                  }
   29.11                  items.append(
   29.12 @@ -59,7 +59,7 @@
   29.13              break
   29.14          case .include:
   29.15              guard let unreadIcon = UIImage(named: "icon-unread") else {
   29.16 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   29.17 +                Log.shared.errorAndCrash("Error Loading images")
   29.18                  return
   29.19              }
   29.20              items.append(
   29.21 @@ -70,7 +70,7 @@
   29.22                                      filter: UnreadFilter()))
   29.23  
   29.24              guard let flaggedIcon = UIImage(named: "icon-flagged") else {
   29.25 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   29.26 +                Log.shared.errorAndCrash("Error Loading images")
   29.27                  return
   29.28              }
   29.29              items.append(
   29.30 @@ -82,7 +82,7 @@
   29.31              break
   29.32          case .other:
   29.33              guard let attachIcon = UIImage(named: "attachment-list-icon") else {
   29.34 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   29.35 +                Log.shared.errorAndCrash("Error Loading images")
   29.36                  return
   29.37              }
   29.38              items.append(
    30.1 --- a/pEpForiOS/UI/Folder/FolderTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    30.2 +++ b/pEpForiOS/UI/Folder/FolderTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    30.3 @@ -108,7 +108,7 @@
    30.4              header = CollapsibleTableViewHeader(reuseIdentifier: "header")
    30.5          }
    30.6          guard let vm = folderVM, let safeHeader = header else {
    30.7 -            Logger.frontendLogger.errorAndCrash("No header or no model.")
    30.8 +            Log.shared.errorAndCrash("No header or no model.")
    30.9              return header
   30.10          }
   30.11  
   30.12 @@ -127,7 +127,7 @@
   30.13      }
   30.14      override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
   30.15          guard let vm = folderVM else {
   30.16 -            Logger.frontendLogger.errorAndCrash("No model.")
   30.17 +            Log.shared.errorAndCrash("No model.")
   30.18              return 0.0
   30.19          }
   30.20          if vm[section].hidden {
   30.21 @@ -141,7 +141,7 @@
   30.22                              cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   30.23          let cell = tableView.dequeueReusableCell(withIdentifier: "Default", for: indexPath)
   30.24          guard let vm = folderVM else {
   30.25 -            Logger.frontendLogger.errorAndCrash("No model")
   30.26 +            Log.shared.errorAndCrash("No model")
   30.27              return cell
   30.28          }
   30.29          let fcvm = vm[indexPath.section][indexPath.item]
   30.30 @@ -160,7 +160,7 @@
   30.31      override func tableView(_ tableView: UITableView, indentationLevelForRowAt indexPath: IndexPath)
   30.32          -> Int {
   30.33              guard let vm = folderVM else {
   30.34 -                Logger.frontendLogger.errorAndCrash("No model")
   30.35 +                Log.shared.errorAndCrash("No model")
   30.36                  return 0
   30.37              }
   30.38          return vm[indexPath.section][indexPath.item].level - 1
   30.39 @@ -170,7 +170,7 @@
   30.40  
   30.41      override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
   30.42          guard let folderViewModel = folderVM else {
   30.43 -            Logger.frontendLogger.errorAndCrash("No model")
   30.44 +            Log.shared.errorAndCrash("No model")
   30.45              return
   30.46          }
   30.47          let cellViewModel = folderViewModel[indexPath.section][indexPath.row]
   30.48 @@ -189,7 +189,7 @@
   30.49              let vc = sb.instantiateViewController(
   30.50                  withIdentifier: EmailListViewController.storyboardId)
   30.51                  as? EmailListViewController else {
   30.52 -                    Logger.frontendLogger.errorAndCrash("Problem!")
   30.53 +                    Log.shared.errorAndCrash("Problem!")
   30.54                      return
   30.55          }
   30.56          vc.appConfig = appConfig
   30.57 @@ -214,7 +214,7 @@
   30.58              guard
   30.59                  let nav = segue.destination as? UINavigationController,
   30.60                  let vc = nav.rootViewController as? LoginViewController else {
   30.61 -                    Logger.frontendLogger.errorAndCrash("Missing VCs")
   30.62 +                    Log.shared.errorAndCrash("Missing VCs")
   30.63                      return
   30.64              }
   30.65              vc.appConfig = self.appConfig
   30.66 @@ -223,7 +223,7 @@
   30.67  
   30.68          } else if segue.identifier == "SettingsSegue" {
   30.69              guard let dvc = segue.destination as? SettingsTableViewController else {
   30.70 -                Logger.frontendLogger.errorAndCrash("Error casting DVC")
   30.71 +                Log.shared.errorAndCrash("Error casting DVC")
   30.72                  return
   30.73              }
   30.74              dvc.appConfig = self.appConfig
    31.1 --- a/pEpForiOS/UI/Folder/ViewModel/FolderSectionViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    31.2 +++ b/pEpForiOS/UI/Folder/ViewModel/FolderSectionViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    31.3 @@ -34,7 +34,7 @@
    31.4  
    31.5      private func generateAccountCells() {
    31.6          guard let ac = account else {
    31.7 -            Logger.frontendLogger.errorAndCrash("No account selected")
    31.8 +            Log.shared.errorAndCrash("No account selected")
    31.9              return
   31.10          }
   31.11          for folder in ac.rootFolders {
   31.12 @@ -52,7 +52,7 @@
   31.13  
   31.14      func getImage(callback: @escaping (UIImage?)-> Void) {
   31.15          guard let ac = account else {
   31.16 -            Logger.frontendLogger.errorAndCrash("No account selected")
   31.17 +            Log.shared.errorAndCrash("No account selected")
   31.18              return
   31.19          }
   31.20          if let cachedContactImage = contactImageTool.cachedIdentityImage(for: ac.user) {
    32.1 --- a/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    32.2 +++ b/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    32.3 @@ -270,7 +270,7 @@
    32.4          do {
    32.5              languages = try theSession.languageList()
    32.6          } catch let err as NSError {
    32.7 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
    32.8 +            Log.shared.error("%{public}@", err.localizedDescription)
    32.9              languages = []
   32.10          }
   32.11  
   32.12 @@ -323,7 +323,7 @@
   32.13          do {
   32.14              destination.languages = try theSession.languageList()
   32.15          } catch let err as NSError {
   32.16 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
   32.17 +            Log.shared.error("%{public}@", err.localizedDescription)
   32.18              destination.languages = []
   32.19          }
   32.20      }
    33.1 --- a/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    33.2 +++ b/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    33.3 @@ -108,7 +108,7 @@
    33.4          do {
    33.5              isPartnerpEpUser = try session.isPEPUser(pEpPartner).boolValue
    33.6          } catch let err as NSError {
    33.7 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
    33.8 +            Log.shared.error("%{public}@", err.localizedDescription)
    33.9              isPartnerpEpUser = false
   33.10          }
   33.11          setPartnerImage(for: partner)
   33.12 @@ -149,7 +149,7 @@
   33.13                  language: trustwordsLanguage,
   33.14                  full: trustwordsFull)
   33.15          } catch let err as NSError {
   33.16 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
   33.17 +            Log.shared.error("%{public}@", err.localizedDescription)
   33.18              return nil
   33.19          }
   33.20      }
    34.1 --- a/pEpForiOS/UI/Login/LoginViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    34.2 +++ b/pEpForiOS/UI/Login/LoginViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    34.3 @@ -162,7 +162,7 @@
    34.4      }
    34.5  
    34.6      private func handleLoginError(error: Error, offerManualSetup: Bool) {
    34.7 -        Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    34.8 +        Log.shared.error("%{public}@", error.localizedDescription)
    34.9          self.isCurrentlyVerifying = false
   34.10          guard let error = DisplayUserError(withError: error) else {
   34.11              // Do nothing. The error type is not suitable to bother the user with.
   34.12 @@ -312,7 +312,7 @@
   34.13      func didVerify(result: AccountVerificationResult, accountInput: AccountUserInput?) {
   34.14          GCD.onMain() { [weak self] in
   34.15              guard let me = self else {
   34.16 -                Logger.frontendLogger.lostMySelf()
   34.17 +                Log.shared.errorAndCrash("Lost MySelf")
   34.18                  return
   34.19              }
   34.20              me.lastAccountInput = nil
    35.1 --- a/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    35.2 +++ b/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    35.3 @@ -105,7 +105,7 @@
    35.4  
    35.5          func statusOk() {
    35.6              if let error = AccountSettings.AccountSettingsError(accountSettings: acSettings) {
    35.7 -                Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    35.8 +                Log.shared.error("%{public}@", error.localizedDescription)
    35.9                  loginViewModelLoginErrorDelegate?.handle(loginError: error)
   35.10                  return
   35.11              }
   35.12 @@ -139,7 +139,7 @@
   35.13              do {
   35.14                  try verifyAccount(model: newAccount)
   35.15              } catch {
   35.16 -                Logger.frontendLogger.error("%{public}@", error.localizedDescription)
   35.17 +                Log.shared.error("%{public}@", error.localizedDescription)
   35.18                  loginViewModelLoginErrorDelegate?.handle(loginError: error)
   35.19              }
   35.20          }
   35.21 @@ -167,11 +167,11 @@
   35.22  
   35.23      func accountHasBeenQualified(trusted: Bool) {
   35.24          guard let verificationService = verificationService else {
   35.25 -            Logger.frontendLogger.errorAndCrash("no VerificationService")
   35.26 +            Log.shared.errorAndCrash("no VerificationService")
   35.27              return
   35.28          }
   35.29          guard let account = loginAccount else {
   35.30 -            Logger.frontendLogger.errorAndCrash("have lost loginAccount")
   35.31 +            Log.shared.errorAndCrash("have lost loginAccount")
   35.32              return
   35.33          }
   35.34          account.imapServer?.trusted = trusted
    36.1 --- a/pEpForiOS/UI/ManualLogin/SMTPSetup/SMTPSettingsTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    36.2 +++ b/pEpForiOS/UI/ManualLogin/SMTPSetup/SMTPSettingsTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    36.3 @@ -161,12 +161,11 @@
    36.4          if result == .ok {
    36.5              MessageModelUtil.performAndWait { [weak self] in
    36.6                  guard let me = self else {
    36.7 -                    Logger.frontendLogger.lostMySelf()
    36.8 +                    Log.shared.errorAndCrash("Lost MySelf")
    36.9                      return
   36.10                  }
   36.11                  guard let account = me.currentlyVerifiedAccount else {
   36.12 -                    Logger.backendLogger.errorAndCrash(
   36.13 -                        "We verified an non-existing account? Now what?")
   36.14 +                    Log.shared.errorAndCrash("We verified an non-existing account? Now what?")
   36.15                      return
   36.16                  }
   36.17                  account.save()
    37.1 --- a/pEpForiOS/UI/MoveToFolder/ViewModel/MoveToFolderViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    37.2 +++ b/pEpForiOS/UI/MoveToFolder/ViewModel/MoveToFolderViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    37.3 @@ -87,7 +87,7 @@
    37.4  
    37.5      func moveMessagesTo(index: Int) -> Bool {
    37.6          if !(index >= 0 && index < items.count) {
    37.7 -            Logger.frontendLogger.error("Index out of bounds")
    37.8 +            Log.shared.error("Index out of bounds")
    37.9              return false
   37.10          }
   37.11          let targetFolder = items[index].folder
    38.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    38.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    38.3 @@ -298,7 +298,7 @@
    38.4  
    38.5  extension AccountSettingsTableViewController {
    38.6      public func handleLoginError(error: Error) {
    38.7 -        Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    38.8 +        Log.shared.error("%{public}@", error.localizedDescription)
    38.9          UIUtils.show(error: error, inViewController: self)
   38.10      }
   38.11  }
    39.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    39.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    39.3 @@ -100,7 +100,7 @@
    39.4                  smtp: ServerViewModel) {
    39.5          guard let serverImap = account.imapServer,
    39.6              let serverSmtp = account.smtpServer else {
    39.7 -                Logger.frontendLogger.errorAndCrash("Account misses imap or smtp server.")
    39.8 +                Log.shared.errorAndCrash("Account misses imap or smtp server.")
    39.9                  return
   39.10          }
   39.11          let pass : String?
   39.12 @@ -119,7 +119,7 @@
   39.13                                            password: pass,
   39.14                                            key: serverSmtp.credentials.key)
   39.15              else {
   39.16 -                Logger.frontendLogger.errorAndCrash("Invalid input.")
   39.17 +                Log.shared.errorAndCrash("Invalid input.")
   39.18                  return
   39.19          }
   39.20  
   39.21 @@ -129,7 +129,7 @@
   39.22          self.account.user.userName = name
   39.23  
   39.24          guard let verificationService = verificationService else {
   39.25 -            Logger.frontendLogger.errorAndCrash("no VerificationService")
   39.26 +            Log.shared.errorAndCrash("no VerificationService")
   39.27              return
   39.28          }
   39.29          verificationService.requestVerification(account: account, delegate: self)
   39.30 @@ -157,7 +157,7 @@
   39.31          guard let viewModelPort = viewModel.port,
   39.32              let port = UInt16(viewModelPort),
   39.33              let address = viewModel.address else {
   39.34 -                Logger.frontendLogger.errorAndCrash("viewModel misses required data.")
   39.35 +                Log.shared.errorAndCrash("viewModel misses required data.")
   39.36                  return nil
   39.37          }
   39.38          let transport = Server.Transport(fromString: viewModel.transport)
   39.39 @@ -197,7 +197,7 @@
   39.40          }
   39.41          GCD.onMainWait { [weak self] in
   39.42              guard let me = self else {
   39.43 -                Logger.frontendLogger.lostMySelf()
   39.44 +                Log.shared.errorAndCrash("Lost MySelf")
   39.45                  return
   39.46              }
   39.47              me.delegate?.didVerify(result: result, accountInput: nil)
    40.1 --- a/pEpForiOS/UI/Settings/Setting/LogViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    40.2 +++ b/pEpForiOS/UI/Settings/Setting/LogViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    40.3 @@ -16,37 +16,37 @@
    40.4      @IBOutlet weak var switchLabel: UILabel!
    40.5      @IBOutlet weak var enableLogSwitch: UISwitch!
    40.6  
    40.7 -    override func viewWillAppear(_ animated: Bool) {
    40.8 -        super.viewWillAppear(animated)
    40.9 -        Log.checkEnabled() { enabled in
   40.10 -            GCD.onMain {
   40.11 -                self.enableLogSwitch.isOn = enabled
   40.12 -                if self.enableLogSwitch.isOn {
   40.13 -                    let version = (InfoPlist.versionDisplayString() ?? "") + "\n"
   40.14 -                    Log.checklog() { logString in
   40.15 -                        GCD.onMain {
   40.16 -                            self.logTextView.text = version + (logString ?? "")
   40.17 -                        }
   40.18 -                    }
   40.19 -                }
   40.20 -            }
   40.21 -        }
   40.22 -    }
   40.23 +//    override func viewWillAppear(_ animated: Bool) {
   40.24 +//        super.viewWillAppear(animated)
   40.25 +//        Log.checkEnabled() { enabled in
   40.26 +//            GCD.onMain {
   40.27 +//                self.enableLogSwitch.isOn = enabled
   40.28 +//                if self.enableLogSwitch.isOn {
   40.29 +//                    let version = (InfoPlist.versionDisplayString() ?? "") + "\n"
   40.30 +//                    Log.checklog() { logString in
   40.31 +//                        GCD.onMain {
   40.32 +//                            self.logTextView.text = version + (logString ?? "")
   40.33 +//                        }
   40.34 +//                    }
   40.35 +//                }
   40.36 +//            }
   40.37 +//        }
   40.38 +//    }
   40.39  
   40.40      @IBAction func copyAction(_ sender: Any) {
   40.41 -        Log.checklog() { logString in
   40.42 -            GCD.onMain {
   40.43 -                UIPasteboard.general.string = logString
   40.44 -            }
   40.45 -        }
   40.46 +//        Log.checklog() { logString in
   40.47 +//            GCD.onMain {
   40.48 +//                UIPasteboard.general.string = logString
   40.49 +//            }
   40.50 +//        }
   40.51      }
   40.52  
   40.53      @IBAction func enableAction(_ sender: Any) {
   40.54 -        if enableLogSwitch.isOn {
   40.55 -            Log.enableLog()
   40.56 -        } else {
   40.57 -            Log.disableLog()
   40.58 -        }
   40.59 +//        if enableLogSwitch.isOn {
   40.60 +//            Log.enableLog()
   40.61 +//        } else {
   40.62 +//            Log.disableLog()
   40.63 +//        }
   40.64      }
   40.65  }
   40.66  
    41.1 --- a/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    41.2 +++ b/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    41.3 @@ -58,7 +58,7 @@
    41.4      func trustedServerSettingCell(sender: TrustedServerSettingCell,
    41.5                                    didChangeSwitchValue newValue: Bool) {
    41.6          guard let address = sender.address.text else {
    41.7 -            Logger.frontendLogger.errorAndCrash("No address.")
    41.8 +            Log.shared.errorAndCrash("No address.")
    41.9              return
   41.10          }
   41.11          viewModel.setStoreSecurely(forAccountWith: address , toValue: newValue)
    42.1 --- a/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    42.2 +++ b/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    42.3 @@ -24,7 +24,7 @@
    42.4  
    42.5      mutating func setStoreSecurely(forAccountWith address: String, toValue newValue: Bool) {
    42.6          guard serversAllowedToManuallyTrust().contains(address) else {
    42.7 -            Logger.frontendLogger.errorAndCrash("Address should be allowed")
    42.8 +            Log.shared.errorAndCrash("Address should be allowed")
    42.9              return
   42.10          }
   42.11  
    43.1 --- a/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    43.2 +++ b/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    43.3 @@ -105,7 +105,7 @@
    43.4              guard
    43.5                  let vm = viewModel[indexPath.section][indexPath.row] as? SettingsCellViewModel,
    43.6                  let cell = dequeuedCell as? SwipeTableViewCell else {
    43.7 -                    Logger.frontendLogger.errorAndCrash("Invalid state.")
    43.8 +                    Log.shared.errorAndCrash("Invalid state.")
    43.9                      return dequeuedCell
   43.10              }
   43.11              cell.textLabel?.text = vm.title
    44.1 --- a/pEpForiOS/UI/Settings/ViewModel/SettingsCellViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    44.2 +++ b/pEpForiOS/UI/Settings/ViewModel/SettingsCellViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    44.3 @@ -63,7 +63,7 @@
    44.4                      "Settings: Cell (button) title to view default account setting")
    44.5              case .account:
    44.6                  guard let acc = account else {
    44.7 -                    Logger.frontendLogger.errorAndCrash("Should never be reached")
    44.8 +                    Log.shared.errorAndCrash("Should never be reached")
    44.9                      return nil
   44.10                  }
   44.11                  return acc.user.address
    45.1 --- a/pEpForiOS/UI/SplitView/PrimarySplitViewcontroller+ScreenComposerProtocol.swift	Fri Apr 12 13:52:08 2019 +0200
    45.2 +++ b/pEpForiOS/UI/SplitView/PrimarySplitViewcontroller+ScreenComposerProtocol.swift	Mon Apr 15 14:29:14 2019 +0200
    45.3 @@ -26,7 +26,7 @@
    45.4              storyboard.instantiateViewController(withIdentifier: "threadViewController")
    45.5                  as? ThreadViewController
    45.6              else {
    45.7 -                Logger.frontendLogger.errorAndCrash("Segue issue")
    45.8 +                Log.shared.errorAndCrash("Segue issue")
    45.9                  return
   45.10          }
   45.11          vc.appConfig = singleViewController.appConfig
   45.12 @@ -53,7 +53,7 @@
   45.13                  as? EmailViewController,
   45.14              let index = emailListViewModel.index(of: message)
   45.15              else {
   45.16 -                Logger.frontendLogger.errorAndCrash("Segue issues")
   45.17 +                Log.shared.errorAndCrash("Segue issues")
   45.18                  return
   45.19          }
   45.20  
    46.1 --- a/pEpForiOS/UI/Thread/Cells/FullMessageCell.swift	Fri Apr 12 13:52:08 2019 +0200
    46.2 +++ b/pEpForiOS/UI/Thread/Cells/FullMessageCell.swift	Mon Apr 15 14:29:14 2019 +0200
    46.3 @@ -119,7 +119,7 @@
    46.4              storyboard.instantiateViewController(withIdentifier: SecureWebViewController.storyboardId)
    46.5                  as? SecureWebViewController
    46.6              else {
    46.7 -                Logger.frontendLogger.errorAndCrash("Cast error")
    46.8 +                Log.shared.errorAndCrash("Cast error")
    46.9                  return SecureWebViewController()
   46.10          }
   46.11          vc.zoomingEnabled = false
    47.1 --- a/pEpForiOS/UI/Thread/ThreadViewController+SegueHandlerType.swift	Fri Apr 12 13:52:08 2019 +0200
    47.2 +++ b/pEpForiOS/UI/Thread/ThreadViewController+SegueHandlerType.swift	Mon Apr 15 14:29:14 2019 +0200
    47.3 @@ -28,7 +28,7 @@
    47.4                  let appConfig = self.appConfig,
    47.5                  let indexPath = tableView.indexPathForSelectedRow,
    47.6                  let message = model?.message(at: indexPath.section) else {
    47.7 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
    47.8 +                    Log.shared.errorAndCrash("Segue issue")
    47.9                      return
   47.10              }
   47.11              vc.appConfig = appConfig
   47.12 @@ -41,7 +41,7 @@
   47.13          case .segueShowMoveToFolder:
   47.14              guard  let nav = segue.destination as? UINavigationController,
   47.15                  let destination = nav.topViewController as? MoveToAccountViewController else {
   47.16 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   47.17 +                    Log.shared.errorAndCrash("No DVC?")
   47.18                      break
   47.19              }
   47.20              destination.appConfig = appConfig
   47.21 @@ -54,7 +54,7 @@
   47.22              guard  let nav = segue.destination as? UINavigationController,
   47.23                  let destination = nav.topViewController as? ComposeTableViewController,
   47.24                  let appConfig = appConfig else {
   47.25 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   47.26 +                    Log.shared.errorAndCrash("No DVC?")
   47.27                      break
   47.28              }
   47.29              destination.appConfig = appConfig
    48.1 --- a/pEpForiOS/UI/Thread/ThreadViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    48.2 +++ b/pEpForiOS/UI/Thread/ThreadViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    48.3 @@ -65,7 +65,7 @@
    48.4  
    48.5      func isSplitViewControllerCollapsed() -> Bool! {
    48.6          guard let splitViewController = self.splitViewController else {
    48.7 -            Logger.frontendLogger.errorAndCrash("We need a splitViewController here")
    48.8 +            Log.shared.errorAndCrash("We need a splitViewController here")
    48.9              return nil
   48.10          }
   48.11          return splitViewController.isCollapsed
    49.1 --- a/pEpForiOS/UI/Util/AddToContactsViewController/AddToContactsViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    49.2 +++ b/pEpForiOS/UI/Util/AddToContactsViewController/AddToContactsViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    49.3 @@ -26,7 +26,7 @@
    49.4  
    49.5      func setupContactVc() {
    49.6          guard let address = emailAddress else {
    49.7 -            Logger.frontendLogger.errorAndCrash("No data to add?")
    49.8 +            Log.shared.errorAndCrash("No data to add?")
    49.9              dismiss(animated: false)
   49.10              return
   49.11          }
   49.12 @@ -35,7 +35,7 @@
   49.13                                                          value: address as NSString))
   49.14          contactVC = CNContactViewController(forUnknownContact: newContact)
   49.15          guard let contactVC = contactVC else {
   49.16 -            Logger.frontendLogger.errorAndCrash("Missing contactVC")
   49.17 +            Log.shared.errorAndCrash("Missing contactVC")
   49.18              return
   49.19          }
   49.20          contactVC.contactStore = CNContactStore()
    50.1 --- a/pEpForiOS/UI/Util/BaseTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    50.2 +++ b/pEpForiOS/UI/Util/BaseTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    50.3 @@ -17,7 +17,7 @@
    50.4      var appConfig: AppConfig {
    50.5          get {
    50.6              guard let safeConfig = _appConfig else {
    50.7 -                Logger.frontendLogger.errorAndCrash("No appConfig?")
    50.8 +                Log.shared.errorAndCrash("No appConfig?")
    50.9  
   50.10                  // We have no config. Return nonsense.
   50.11                  return AppConfig(
   50.12 @@ -41,7 +41,7 @@
   50.13          super.viewWillAppear(animated)
   50.14          guard _appConfig != nil else {
   50.15              if !MiscUtil.isUnitTest() {
   50.16 -                Logger.frontendLogger.errorAndCrash("AppConfig is nil in viewWillAppear!")
   50.17 +                Log.shared.errorAndCrash("AppConfig is nil in viewWillAppear!")
   50.18              }
   50.19              return
   50.20          }
   50.21 @@ -129,6 +129,6 @@
   50.22  
   50.23  extension BaseTableViewController: KickOffMySelfProtocol {
   50.24      func startMySelf() {
   50.25 -        Logger.frontendLogger.errorAndCrash("No appConfig?")
   50.26 +        Log.shared.errorAndCrash("No appConfig?")
   50.27      }
   50.28  }
    51.1 --- a/pEpForiOS/UI/Util/BaseViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    51.2 +++ b/pEpForiOS/UI/Util/BaseViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    51.3 @@ -16,7 +16,7 @@
    51.4      var appConfig: AppConfig! {
    51.5          get {
    51.6              guard _appConfig != nil else {
    51.7 -                Logger.frontendLogger.errorAndCrash("No appConfig?")
    51.8 +                Log.shared.errorAndCrash("No appConfig?")
    51.9                  return nil
   51.10              }
   51.11              return _appConfig
    52.1 --- a/pEpForiOS/UI/Util/Extensions/UIView+Autolayout.swift	Fri Apr 12 13:52:08 2019 +0200
    52.2 +++ b/pEpForiOS/UI/Util/Extensions/UIView+Autolayout.swift	Mon Apr 15 14:29:14 2019 +0200
    52.3 @@ -13,7 +13,7 @@
    52.4      /// Sets up constraints to always stay the same size as the superview.
    52.5      public func fullSizeInSuperView() {
    52.6          guard let superview = self.superview else {
    52.7 -            Logger.frontendLogger.errorAndCrash("No superview")
    52.8 +            Log.shared.errorAndCrash("No superview")
    52.9              return
   52.10          }
   52.11  
    53.1 --- a/pEpForiOS/UI/Util/InfoPlist.swift	Fri Apr 12 13:52:08 2019 +0200
    53.2 +++ b/pEpForiOS/UI/Util/InfoPlist.swift	Mon Apr 15 14:29:14 2019 +0200
    53.3 @@ -30,7 +30,7 @@
    53.4      
    53.5      static private func mainBundleInfoDictValue(forKey key: String) -> Any? {
    53.6          guard let infoDict = infoDictMainBundle else {
    53.7 -            Logger.utilLogger.errorAndCrash("No info dict")
    53.8 +            Log.shared.errorAndCrash("No info dict")
    53.9              return nil
   53.10          }
   53.11          return infoDict[key]
    54.1 --- a/pEpForiOS/UI/Util/SecureWebViewController/CidHandler.swift	Fri Apr 12 13:52:08 2019 +0200
    54.2 +++ b/pEpForiOS/UI/Util/SecureWebViewController/CidHandler.swift	Mon Apr 15 14:29:14 2019 +0200
    54.3 @@ -36,7 +36,7 @@
    54.4              urlSchemeTask.didFinish()
    54.5          }
    54.6          guard let url = urlSchemeTask.request.url else {
    54.7 -            Logger.frontendLogger.errorAndCrash("No URL?")
    54.8 +            Log.shared.errorAndCrash("No URL?")
    54.9              return
   54.10          }
   54.11  
    55.1 --- a/pEpForiOS/UI/Util/SecureWebViewController/SecureWebViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    55.2 +++ b/pEpForiOS/UI/Util/SecureWebViewController/SecureWebViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    55.3 @@ -168,13 +168,13 @@
    55.4                  forIdentifier: "pep.security.SecureWebViewController.block_all_external_content",
    55.5                  encodedContentRuleList: blockRules) { (contentRuleList, error) in
    55.6                      if let error = error {
    55.7 -                        Logger.frontendLogger.errorAndCrash(
    55.8 +                        Log.shared.errorAndCrash(
    55.9                              "Compile error: %@", error.localizedDescription)
   55.10                          return
   55.11                      }
   55.12                      compiledBlockList = contentRuleList
   55.13                      guard let _ = compiledBlockList else {
   55.14 -                        Logger.frontendLogger.errorAndCrash(
   55.15 +                        Log.shared.errorAndCrash(
   55.16                              "Emergency exit. External content not blocked.")
   55.17                          completion()
   55.18                          return
   55.19 @@ -228,7 +228,7 @@
   55.20          let handler = {
   55.21              [weak self] (scrollView: UIScrollView, change: NSKeyValueObservedChange<CGSize>) in
   55.22              guard let me = self else {
   55.23 -                Logger.backendLogger.lostMySelf()
   55.24 +                Log.shared.errorAndCrash("Lost MySelf")
   55.25                  return
   55.26              }
   55.27  
   55.28 @@ -376,7 +376,7 @@
   55.29              return
   55.30          case .linkActivated:
   55.31              guard let url = navigationAction.request.url else {
   55.32 -                Logger.frontendLogger.errorAndCrash("Link to nonexisting URL has been clicked?")
   55.33 +                Log.shared.errorAndCrash("Link to nonexisting URL has been clicked?")
   55.34                  break
   55.35              }
   55.36              if url.scheme == "mailto" {
    56.1 --- a/pEpForiOS/UI/Util/SuggestTableViewController/SuggestTableViewController.swift	Fri Apr 12 13:52:08 2019 +0200
    56.2 +++ b/pEpForiOS/UI/Util/SuggestTableViewController/SuggestTableViewController.swift	Mon Apr 15 14:29:14 2019 +0200
    56.3 @@ -34,7 +34,7 @@
    56.4  extension SuggestTableViewController {
    56.5      override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    56.6          guard let viewModel = viewModel else {
    56.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    56.8 +            Log.shared.errorAndCrash("No VM")
    56.9              return
   56.10          }
   56.11          viewModel.handleRowSelected(at: indexPath.row)
   56.12 @@ -48,7 +48,7 @@
   56.13      public override func tableView(_ tableView: UITableView,
   56.14                                     numberOfRowsInSection section: Int) -> Int {
   56.15          guard let viewModel = viewModel else {
   56.16 -            Logger.frontendLogger.errorAndCrash("No VM")
   56.17 +            Log.shared.errorAndCrash("No VM")
   56.18              return 0
   56.19          }
   56.20          return viewModel.numRows
   56.21 @@ -61,7 +61,7 @@
   56.22              let cell = tableView.dequeueReusableCell(withIdentifier: ContactCell.reuseId,
   56.23                                                         for: indexPath)
   56.24              as? ContactCell else {
   56.25 -                Logger.frontendLogger.errorAndCrash("Illegal state")
   56.26 +                Log.shared.errorAndCrash("Illegal state")
   56.27                  return UITableViewCell()
   56.28          }
   56.29          let row = viewModel.row(at: indexPath.row)
    57.1 --- a/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Fri Apr 12 13:52:08 2019 +0200
    57.2 +++ b/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Mon Apr 15 14:29:14 2019 +0200
    57.3 @@ -54,7 +54,7 @@
    57.4  
    57.5      public func handleRowSelected(at index: Int) {
    57.6          guard index < identities.count else {
    57.7 -            Logger.frontendLogger.errorAndCrash("Out of bounds")
    57.8 +            Log.shared.errorAndCrash("Out of bounds")
    57.9              return
   57.10          }
   57.11          resultDelegate?.suggestViewModelDidSelectContact(identity: identities[index])
   57.12 @@ -66,7 +66,7 @@
   57.13  
   57.14      public func row(at index: Int) -> Row {
   57.15          guard index < identities.count else {
   57.16 -            Logger.frontendLogger.errorAndCrash("Index out of bounds")
   57.17 +            Log.shared.errorAndCrash("Index out of bounds")
   57.18              return Row(name: "Problem", email: "child")
   57.19          }
   57.20          let identity = identities[index]
    58.1 --- a/pEpForiOS/UI/Util/UIUtils.swift	Fri Apr 12 13:52:08 2019 +0200
    58.2 +++ b/pEpForiOS/UI/Util/UIUtils.swift	Mon Apr 15 14:29:14 2019 +0200
    58.3 @@ -19,7 +19,7 @@
    58.4      ///   - error: error to preset to user
    58.5      ///   - vc: ViewController to present the error on
    58.6      static func show(error: Error, inViewController vc: UIViewController) {
    58.7 -//        Logger.utilLogger.errorAndCrash("Will display error to user: %@",
    58.8 +//        Log.shared.errorAndCrash("Will display error to user: %@",
    58.9  //                                                    error.localizedDescription)
   58.10          guard let displayError = DisplayUserError(withError: error) else {
   58.11              // Do nothing. The error type is not suitable to bother the user with.
   58.12 @@ -92,7 +92,7 @@
   58.13              let composeVc = composeNavigationController.rootViewController
   58.14                  as? ComposeTableViewController
   58.15              else {
   58.16 -                Logger.utilLogger.errorAndCrash("Missing required data")
   58.17 +                Log.shared.errorAndCrash("Missing required data")
   58.18                  return
   58.19          }
   58.20          var prefilledTo: Identity? = nil
   58.21 @@ -124,7 +124,7 @@
   58.22          let storyboard = UIStoryboard(name: Constants.addToContactsStoryboard, bundle: nil)
   58.23          guard let contactVc = storyboard.instantiateViewController(withIdentifier:
   58.24              AddToContactsViewController.storyboardId) as? AddToContactsViewController else {
   58.25 -                Logger.utilLogger.errorAndCrash("Missing required data")
   58.26 +                Log.shared.errorAndCrash("Missing required data")
   58.27                  return
   58.28          }
   58.29          contactVc.appConfig = appConfig
   58.30 @@ -148,11 +148,11 @@
   58.31                                                       at view: UIView,
   58.32                                                       appConfig: AppConfig) {
   58.33          guard let _ = UrlClickHandler.Scheme(for: url) else {
   58.34 -            Logger.utilLogger.errorAndCrash("Unsupported scheme")
   58.35 +            Log.shared.errorAndCrash("Unsupported scheme")
   58.36              return
   58.37          }
   58.38          guard let address = url.firstRecipientAddress() else {
   58.39 -            Logger.utilLogger.errorAndCrash("No address")
   58.40 +            Log.shared.errorAndCrash("No address")
   58.41              return
   58.42          }
   58.43          presentActionSheetWithContactOptions(forContactWithEmailAddress: address,
   58.44 @@ -239,7 +239,7 @@
   58.45  
   58.46      static func presentSettings(on viewController: UIViewController, appConfig: AppConfig) {
   58.47          guard let vc = UIStoryboard.init(name: "Settings", bundle: Bundle.main).instantiateViewController(withIdentifier: SettingsTableViewController.storyboardId) as? SettingsTableViewController else {
   58.48 -            Logger.utilLogger.errorAndCrash("No controller")
   58.49 +            Log.shared.errorAndCrash("No controller")
   58.50              return
   58.51          }
   58.52          vc.appConfig = appConfig
    59.1 --- a/pEpForiOS/Util/DebugMergePolicy.swift	Fri Apr 12 13:52:08 2019 +0200
    59.2 +++ b/pEpForiOS/Util/DebugMergePolicy.swift	Mon Apr 15 14:29:14 2019 +0200
    59.3 @@ -38,7 +38,7 @@
    59.4                  for c in conflictingObjects {
    59.5                      logString += "\n* \(c.keyPath):\n\(String(describing: c.o1))\n->\n\(String(describing: c.o2))"
    59.6                  }
    59.7 -                Logger.utilLogger.error("%{public}@", logString)
    59.8 +                Log.shared.error("%{public}@", logString)
    59.9              }
   59.10          }
   59.11      }
    60.1 --- a/pEpForiOS/Util/Extensions/ConnectionTransport+AccountSettings.swift	Fri Apr 12 13:52:08 2019 +0200
    60.2 +++ b/pEpForiOS/Util/Extensions/ConnectionTransport+AccountSettings.swift	Mon Apr 15 14:29:14 2019 +0200
    60.3 @@ -18,7 +18,7 @@
    60.4          case .startTLS: self = .startTLS
    60.5          case .TLS: self = .TLS
    60.6          case .unknown:
    60.7 -            Logger.utilLogger.errorAndCrash(
    60.8 +            Log.shared.errorAndCrash(
    60.9                  "Unsupported LAS transport: %d", accountSettingsTransport.rawValue)
   60.10              self = .plain
   60.11          }
    61.1 --- a/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Fri Apr 12 13:52:08 2019 +0200
    61.2 +++ b/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Mon Apr 15 14:29:14 2019 +0200
    61.3 @@ -31,7 +31,7 @@
    61.4               .underAttack:
    61.5              return false
    61.6          default:
    61.7 -            Logger.utilLogger.errorAndCrash(
    61.8 +            Log.shared.errorAndCrash(
    61.9                  "cannot decide isUnderAttack() for %{public}@", self.rawValue)
   61.10              return false
   61.11          }
   61.12 @@ -57,7 +57,7 @@
   61.13               .underAttack:
   61.14              return false
   61.15          default:
   61.16 -            Logger.utilLogger.errorAndCrash(
   61.17 +            Log.shared.errorAndCrash(
   61.18                  "cannot decide isUnderAttack() for %{public}@", self.rawValue)
   61.19              return false
   61.20          }
    62.1 --- a/pEpForiOS/Util/Log/Log+ASL.swift	Fri Apr 12 13:52:08 2019 +0200
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,213 +0,0 @@
    62.4 -//
    62.5 -//  Log+ASL.swift
    62.6 -//  pEp
    62.7 -//
    62.8 -//  Created by Dirk Zimmermann on 03.10.18.
    62.9 -//  Copyright © 2018 p≡p Security S.A. All rights reserved.
   62.10 -//
   62.11 -
   62.12 -import Foundation
   62.13 -import asl
   62.14 -
   62.15 -class ASLLogger: ActualLoggerProtocol {
   62.16 -    func saveLog(severity: LoggingSeverity,
   62.17 -                 entity: String,
   62.18 -                 description: String,
   62.19 -                 comment: String) {
   62.20 -        let logMessage = asl_new(UInt32(ASL_TYPE_MSG))
   62.21 -
   62.22 -        asl_set(logMessage, ASL_KEY_SENDER, sender)
   62.23 -        asl_set(logMessage, ASL_KEY_FACILITY, entity)
   62.24 -        asl_set(logMessage, ASL_KEY_MSG, "\(description) [\(comment)]")
   62.25 -        asl_set(logMessage, ASL_KEY_LEVEL, "\(severity.aslLevel())")
   62.26 -
   62.27 -        let nowDate = Date()
   62.28 -        let dateString = "\(Int(nowDate.timeIntervalSince1970))"
   62.29 -        asl_set(logMessage, ASL_KEY_TIME, dateString)
   62.30 -
   62.31 -        asl_set(logMessage, ASL_KEY_READ_UID, "-1")
   62.32 -
   62.33 -        asl_send(self.consoleClient, logMessage)
   62.34 -        asl_free(logMessage)
   62.35 -    }
   62.36 -
   62.37 -    func retrieveLog() -> String {
   62.38 -        let query = asl_new(UInt32(ASL_TYPE_QUERY))
   62.39 -
   62.40 -        var result = asl_set_query(
   62.41 -            query,
   62.42 -            ASL_KEY_SENDER,
   62.43 -            sender,
   62.44 -            UInt32(ASL_QUERY_OP_EQUAL))
   62.45 -        ASLLogger.checkASLSuccess(result: result, comment: "asl_set_query ASL_KEY_SENDER")
   62.46 -
   62.47 -        let fromDate = Date(timeInterval: -600, since: Date())
   62.48 -        let fromDateString = "\(Int(fromDate.timeIntervalSince1970))"
   62.49 -        result = asl_set_query(
   62.50 -            query,
   62.51 -            ASL_KEY_TIME,
   62.52 -            fromDateString,
   62.53 -            UInt32(ASL_QUERY_OP_GREATER_EQUAL))
   62.54 -        ASLLogger.checkASLSuccess(result: result, comment: "asl_set_query ASL_KEY_TIME")
   62.55 -
   62.56 -        let theClient = createConsoleLogger()
   62.57 -
   62.58 -        let response = asl_search(theClient, query)
   62.59 -        var next = asl_next(response)
   62.60 -        var logString = ""
   62.61 -        while next != nil {
   62.62 -            let timeString = String(cString: asl_get(next, ASL_KEY_TIME))
   62.63 -            let messageString = String(cString: asl_get(next, ASL_KEY_MSG))
   62.64 -            let facilityString = String(cString: asl_get(next, ASL_KEY_FACILITY))
   62.65 -            let levelString = String(cString: asl_get(next, ASL_KEY_LEVEL))
   62.66 -
   62.67 -            let level = levelString.aslLevelStringToASL()
   62.68 -            let ownLevelString = level.criticalityString()
   62.69 -
   62.70 -            var dateString = "<NoTime>"
   62.71 -            if let dateInt = Int(timeString) {
   62.72 -                let date = Date(timeIntervalSince1970: TimeInterval(dateInt))
   62.73 -                dateString = "\(date)"
   62.74 -            }
   62.75 -
   62.76 -            if !logString.isEmpty {
   62.77 -                logString.append("\n")
   62.78 -            }
   62.79 -
   62.80 -            let stringToLog = "\(dateString) [\(ownLevelString)] [\(facilityString)] \(messageString)"
   62.81 -            logString.append(stringToLog)
   62.82 -
   62.83 -            next = asl_next(response)
   62.84 -        }
   62.85 -
   62.86 -        asl_free(query)
   62.87 -        asl_free(response)
   62.88 -        asl_free(theClient)
   62.89 -
   62.90 -        return logString
   62.91 -    }
   62.92 -
   62.93 -    init() {
   62.94 -        self.consoleClient = createConsoleLogger()
   62.95 -    }
   62.96 -
   62.97 -    deinit {
   62.98 -        asl_release(consoleClient)
   62.99 -    }
  62.100 -
  62.101 -    private let sender = "security.pEp.app.iOS"
  62.102 -
  62.103 -    private var consoleClient: aslclient?
  62.104 -
  62.105 -    private func createConsoleLogger() -> asl_object_t {
  62.106 -        return asl_open(self.sender, "default", 0)
  62.107 -    }
  62.108 -
  62.109 -    private static func checkASLSuccess(result: Int32, comment: String) {
  62.110 -        if result != 0 {
  62.111 -            print("error: \(comment)")
  62.112 -        }
  62.113 -    }
  62.114 -}
  62.115 -
  62.116 -extension LoggingSeverity {
  62.117 -    /**
  62.118 -     Maps the internal criticality of a log  message into a subsystem of ASL levels.
  62.119 -
  62.120 -     ASL has the following:
  62.121 -     * ASL_LEVEL_EMERG
  62.122 -     * ASL_LEVEL_ALERT
  62.123 -     * ASL_LEVEL_CRIT
  62.124 -     * ASL_LEVEL_ERR
  62.125 -     * ASL_LEVEL_WARNING
  62.126 -     * ASL_LEVEL_NOTICE
  62.127 -     * ASL_LEVEL_INFO
  62.128 -     * ASL_LEVEL_DEBUG
  62.129 -     */
  62.130 -    func aslLevel() -> Int32 {
  62.131 -        switch self {
  62.132 -        case .verbose:
  62.133 -            return ASL_LEVEL_DEBUG
  62.134 -        case .info:
  62.135 -            return ASL_LEVEL_NOTICE
  62.136 -        case .warning:
  62.137 -            return ASL_LEVEL_WARNING
  62.138 -        case .error:
  62.139 -            return ASL_LEVEL_ERR
  62.140 -        }
  62.141 -    }
  62.142 -}
  62.143 -
  62.144 -extension String {
  62.145 -    func aslLevelStringToASL() -> Int32 {
  62.146 -        switch self {
  62.147 -        case "0":
  62.148 -            return ASL_LEVEL_EMERG
  62.149 -        case "1":
  62.150 -            return ASL_LEVEL_ALERT
  62.151 -        case "2":
  62.152 -            return ASL_LEVEL_CRIT
  62.153 -        case "3":
  62.154 -            return ASL_LEVEL_ERR
  62.155 -        case "4":
  62.156 -            return ASL_LEVEL_WARNING
  62.157 -        case "5":
  62.158 -            return ASL_LEVEL_NOTICE
  62.159 -        case "6":
  62.160 -            return ASL_LEVEL_INFO
  62.161 -        case "7":
  62.162 -            return ASL_LEVEL_DEBUG
  62.163 -
  62.164 -        default:
  62.165 -            return ASL_LEVEL_DEBUG
  62.166 -        }
  62.167 -    }
  62.168 -}
  62.169 -
  62.170 -extension Int32 {
  62.171 -    func criticalityString() -> String {
  62.172 -        switch self {
  62.173 -        case ASL_LEVEL_EMERG:
  62.174 -            return "EMERG"
  62.175 -        case ASL_LEVEL_ALERT:
  62.176 -            return "ALERT"
  62.177 -        case ASL_LEVEL_CRIT:
  62.178 -            return "CRIT"
  62.179 -        case ASL_LEVEL_ERR:
  62.180 -            return "ERR"
  62.181 -        case ASL_LEVEL_WARNING:
  62.182 -            return "WARNING"
  62.183 -        case ASL_LEVEL_NOTICE:
  62.184 -            return "NOTICE"
  62.185 -        case ASL_LEVEL_INFO:
  62.186 -            return "INFO"
  62.187 -        case ASL_LEVEL_DEBUG:
  62.188 -            return "DEBUG"
  62.189 -        default:
  62.190 -            return "UNKNOWN"
  62.191 -        }
  62.192 -    }
  62.193 -
  62.194 -    func aslLevelString() -> String {
  62.195 -        switch self {
  62.196 -        case ASL_LEVEL_EMERG:
  62.197 -            return "ASL_LEVEL_EMERG"
  62.198 -        case ASL_LEVEL_ALERT:
  62.199 -            return "ASL_LEVEL_ALERT"
  62.200 -        case ASL_LEVEL_CRIT:
  62.201 -            return "ASL_LEVEL_CRIT"
  62.202 -        case ASL_LEVEL_ERR:
  62.203 -            return "ASL_LEVEL_ERR"
  62.204 -        case ASL_LEVEL_WARNING:
  62.205 -            return "ASL_LEVEL_WARNING"
  62.206 -        case ASL_LEVEL_NOTICE:
  62.207 -            return "ASL_LEVEL_NOTICE"
  62.208 -        case ASL_LEVEL_INFO:
  62.209 -            return "ASL_LEVEL_INFO"
  62.210 -        case ASL_LEVEL_DEBUG:
  62.211 -            return "ASL_LEVEL_DEBUG"
  62.212 -        default:
  62.213 -            return "ASL_LEVEL_UNKNOWN"
  62.214 -        }
  62.215 -    }
  62.216 -}
    63.1 --- a/pEpForiOS/Util/Log/Log.swift	Fri Apr 12 13:52:08 2019 +0200
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,208 +0,0 @@
    63.4 -//
    63.5 -//  Log.swift
    63.6 -//  pEpForiOS
    63.7 -//
    63.8 -//  Created by Dirk Zimmermann on 08/04/16.
    63.9 -//  Copyright © 2016 p≡p Security S.A. All rights reserved.
   63.10 -//
   63.11 -
   63.12 -import os.log
   63.13 -
   63.14 -import MessageModel
   63.15 -
   63.16 -enum LoggingSeverity {
   63.17 -    case verbose
   63.18 -    case info
   63.19 -    case warning
   63.20 -    case error
   63.21 -}
   63.22 -
   63.23 -/**
   63.24 - Handling the actual logging.
   63.25 - */
   63.26 -protocol ActualLoggerProtocol {
   63.27 -    func saveLog(severity: LoggingSeverity,
   63.28 -                 entity: String,
   63.29 -                 description: String,
   63.30 -                 comment: String)
   63.31 -
   63.32 -    func retrieveLog() -> String
   63.33 -}
   63.34 -
   63.35 -/** Very primitive Logging class. */
   63.36 -@objc open class Log: NSObject {
   63.37 -    static public let shared: Log = {
   63.38 -        let instance = Log()
   63.39 -        return instance
   63.40 -    }()
   63.41 -
   63.42 -    static public func disableLog() {
   63.43 -        Log.shared.loggingQueue.addOperation() {
   63.44 -            Log.shared.logEnabled = false
   63.45 -        }
   63.46 -    }
   63.47 -
   63.48 -    static public func enableLog() {
   63.49 -        Log.shared.loggingQueue.addOperation() {
   63.50 -            Log.shared.logEnabled = true
   63.51 -        }
   63.52 -    }
   63.53 -
   63.54 -    static public func checkEnabled(_ block: ((Bool) -> ())?) {
   63.55 -        Log.shared.loggingQueue.addOperation() {
   63.56 -            let b = Log.shared.logEnabled
   63.57 -            block?(b)
   63.58 -        }
   63.59 -    }
   63.60 -
   63.61 -    static public func checklog(_ block: ((String?) -> ())?) {
   63.62 -        Log.shared.loggingQueue.addOperation() {
   63.63 -            let logString = Log.shared.internalLogger.retrieveLog()
   63.64 -            block?(logString)
   63.65 -        }
   63.66 -    }
   63.67 -
   63.68 -    static public func verbose(component: String, content: String) {
   63.69 -        Log.shared.saveLog(severity:.verbose,
   63.70 -                           entity: component, description: content, comment: "verbose")
   63.71 -    }
   63.72 -
   63.73 -    /** Somewhat verbose */
   63.74 -    static public func info(component: String, content: String) {
   63.75 -        Log.shared.saveLog(severity:.info,
   63.76 -                           entity: component, description: content, comment: "info")
   63.77 -    }
   63.78 -
   63.79 -    /** More important */
   63.80 -    static public func warn(component: String, content: String) {
   63.81 -        Log.shared.saveLog(severity:.warning,
   63.82 -                           entity: component, description: content, comment: "warn")
   63.83 -    }
   63.84 -
   63.85 -    static public func error(component: String, error: Error?) {
   63.86 -        if let err = error {
   63.87 -            Log.shared.saveLog(severity:.error,
   63.88 -                               entity: component, description: " \(err)", comment: "error")
   63.89 -        }
   63.90 -    }
   63.91 -
   63.92 -    static public func error(component: String, errorString: String, error: Error) {
   63.93 -        Log.shared.saveLog(severity:.error,
   63.94 -                           entity: component, description: "\(errorString) \(error)", comment: "error")
   63.95 -    }
   63.96 -
   63.97 -    static public func error(component: String, errorString: String) {
   63.98 -        Log.shared.saveLog(severity:.error,
   63.99 -                           entity: component, description: errorString, comment: "error")
  63.100 -    }
  63.101 -
  63.102 -    public static func log(comp: String, mySelf: AnyObject, functionName: String) {
  63.103 -        let selfDesc = unsafeBitCast(mySelf, to: UnsafeRawPointer.self)
  63.104 -        Log.shared.info(component: comp, content: "\(functionName): \(selfDesc)")
  63.105 -    }
  63.106 -
  63.107 -    public func resume() {
  63.108 -        Log.shared.paused = false
  63.109 -    }
  63.110 -
  63.111 -    public func pause() {
  63.112 -        Log.shared.paused = true
  63.113 -        Log.shared.loggingQueue.cancelAllOperations()
  63.114 -    }
  63.115 -
  63.116 -    private let title = "pEpForiOS"
  63.117 -    private var logEnabled = true
  63.118 -    private var paused = false
  63.119 -
  63.120 -    private let loggingQueue: OperationQueue = {
  63.121 -        let createe = OperationQueue()
  63.122 -        createe.qualityOfService = .background
  63.123 -        createe.maxConcurrentOperationCount = 1
  63.124 -        return createe
  63.125 -    }()
  63.126 -
  63.127 -    private let internalLogger = ASLLogger()
  63.128 -
  63.129 -    /**
  63.130 -     Prints and/or saves a log entry.
  63.131 -     - Note: For a log to be printed, the entity must be contained in `allowedEntities`,
  63.132 -     or the severity must be noted in `allowedSeverities`.
  63.133 -     */
  63.134 -    private func saveLog(severity: LoggingSeverity,
  63.135 -                         entity: String,
  63.136 -                         description: String,
  63.137 -                         comment: String) {
  63.138 -        let allowedEntities = Set<String>(["CWIMAPStore", "ImapSync"])
  63.139 -        let allowedSeverities = Set<LoggingSeverity>([.error, .warning, .info])
  63.140 -
  63.141 -        if allowedSeverities.contains(severity) || allowedEntities.contains(entity) {
  63.142 -            internalLogger.saveLog(severity: severity,
  63.143 -                                   entity: entity,
  63.144 -                                   description: description,
  63.145 -                                   comment: comment)
  63.146 -        }
  63.147 -    }
  63.148 -}
  63.149 -
  63.150 -extension Log: MessageModelLogging {
  63.151 -    public func verbose(component: String, content: String) {
  63.152 -        Log.verbose(component: component, content: content)
  63.153 -    }
  63.154 -
  63.155 -    public func info(component: String, content: String) {
  63.156 -        Log.info(component: component, content: content)
  63.157 -    }
  63.158 -
  63.159 -    public func warn(component: String, content: String) {
  63.160 -        Log.warn(component: component, content: content)
  63.161 -    }
  63.162 -
  63.163 -    public func error(component: String, error: Error) {
  63.164 -        Log.error(component: component, error: error)
  63.165 -    }
  63.166 -
  63.167 -    public func error(component: String, errorString: String, error: Error) {
  63.168 -        Log.error(component: component, errorString: errorString, error: error)
  63.169 -    }
  63.170 -
  63.171 -    public func error(component: String, errorString: String) {
  63.172 -        Log.error(component: component, errorString: errorString)
  63.173 -    }
  63.174 -
  63.175 -    /// Logs component and error.
  63.176 -    ///
  63.177 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  63.178 -    ///
  63.179 -    /// - Parameters:
  63.180 -    ///   - component: caller information to log
  63.181 -    ///   - error: error to log
  63.182 -    public func errorAndCrash(component: String, error: Error) {
  63.183 -        Log.error(component: component, error: error)
  63.184 -        SystemUtils.crash("ERROR \(component): \(error.localizedDescription)")
  63.185 -    }
  63.186 -
  63.187 -    /// Logs component and error.
  63.188 -    ///
  63.189 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  63.190 -    ///
  63.191 -    /// - Parameters:
  63.192 -    ///   - component: caller information to log
  63.193 -    ///   - errorString: error information to log
  63.194 -    ///   - error: error to log
  63.195 -    public func errorAndCrash(component: String, errorString: String, error: Error) {
  63.196 -        Log.error(component: component, errorString: errorString, error: error)
  63.197 -        SystemUtils.crash("ERROR \(component): \(errorString): \(error.localizedDescription)")
  63.198 -    }
  63.199 -
  63.200 -    /// Logs component and error.
  63.201 -    ///
  63.202 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  63.203 -    ///
  63.204 -    /// - Parameters:
  63.205 -    ///   - component: caller information to log
  63.206 -    ///   - errorString: error information to log
  63.207 -    public func errorAndCrash(component: String, errorString: String) {
  63.208 -        Log.error(component: component, errorString: errorString)
  63.209 -        SystemUtils.crash("ERROR \(component): \(errorString)")
  63.210 -    }
  63.211 -}
    64.1 --- a/pEpForiOS/Util/ReferenceCounter.swift	Fri Apr 12 13:52:08 2019 +0200
    64.2 +++ b/pEpForiOS/Util/ReferenceCounter.swift	Mon Apr 15 14:29:14 2019 +0200
    64.3 @@ -59,7 +59,7 @@
    64.4      public static func logOutstanding() {
    64.5          for (_, entry) in table {
    64.6              if entry.count != 0 {
    64.7 -                Logger.utilLogger.warn("%{public}@", entry.description)
    64.8 +                Log.shared.warn("%{public}@", entry.description)
    64.9              }
   64.10          }
   64.11      }
    65.1 --- a/pEpForiOS/Util/UserNotificationTool.swift	Fri Apr 12 13:52:08 2019 +0200
    65.2 +++ b/pEpForiOS/Util/UserNotificationTool.swift	Mon Apr 15 14:29:14 2019 +0200
    65.3 @@ -64,7 +64,7 @@
    65.4                                                  content: content, trigger: trigger)
    65.5              center.add(request) { (error) in
    65.6                  if let error = error {
    65.7 -                    Logger.utilLogger.warn(
    65.8 +                    Log.shared.warn(
    65.9                          "Error posting user notification: %{public}@",
   65.10                          error.localizedDescription)
   65.11                  }
    66.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Fri Apr 12 13:52:08 2019 +0200
    66.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Mon Apr 15 14:29:14 2019 +0200
    66.3 @@ -30,6 +30,7 @@
    66.4          do {
    66.5              try write(to: url)
    66.6          } catch {
    66.7 +            
    66.8              Logger.utilLogger.error("Could not save to %{public}@", url.absoluteString)
    66.9          }
   66.10      }