merge refactor IOS-1551
authorAlejandro Gelos <agp@pep.security>
Fri, 10 May 2019 10:50:12 +0200
branchIOS-1551
changeset 86533b85dc6f7722
parent 8523 58d55fcb0ae7
child 8654 96440ec936a3
merge refactor
Submodules/pEpIOSToolbox/pEpIOSToolbox/Modules/Log.swift
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift
Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/SortedSet.swift
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/AppDelegate.swift
pEpForiOS/Base.lproj/Main.storyboard
pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift
pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift
pEpForiOS/Models/Log.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.xcodeproj/project.pbxproj
subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift
subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Modules/Log.swift	Fri May 10 10:50:12 2019 +0200
     1.3 @@ -0,0 +1,17 @@
     1.4 +//
     1.5 +//  Log.swift
     1.6 +//  pEpIOSToolbox
     1.7 +//
     1.8 +//  Created by Alejandro Gelos on 03/05/2019.
     1.9 +//  Copyright © 2019 pEp Security SA. All rights reserved.
    1.10 +//
    1.11 +
    1.12 +import Foundation
    1.13 +
    1.14 +/// Shared instance of logger.
    1.15 +class Log {
    1.16 +    static let shared = Logger(subsystem: "security.pEp.pEpForiOS", category: "pEpIOSToolbox")
    1.17 +
    1.18 +    /// Init is forbidden. Singleton...
    1.19 +    private init() {}
    1.20 +}
     2.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Wed May 08 12:23:41 2019 +0200
     2.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Logger.swift	Fri May 10 10:50:12 2019 +0200
     2.3 @@ -58,21 +58,6 @@
     2.4          }
     2.5      }
     2.6  
     2.7 -    //!!!: remove this loggers  from to the app if any
     2.8 -
     2.9 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.10 -    public static let frontendLogger = Logger(category: "frontend")
    2.11 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.12 -    public static let backendLogger = Logger(category: "backend")
    2.13 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.14 -    public static let utilLogger = Logger(category: "util")
    2.15 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.16 -    public static let htmlParsingLogger = Logger(category: "htmlParsing")
    2.17 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.18 -    public static let modelLogger = Logger(category: "model")
    2.19 -    @available(*, deprecated, message: "Instead create a singleton per Xcode project (Module) yourself")
    2.20 -    public static let appDelegateLogger = Logger(category: "appDelegate")
    2.21 -
    2.22      public init(subsystem: String = "security.pEp.app.iOS", category: String) {
    2.23          self.subsystem = subsystem
    2.24          self.category = category
     3.1 --- a/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/SortedSet.swift	Wed May 08 12:23:41 2019 +0200
     3.2 +++ b/Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/SortedSet.swift	Fri May 10 10:50:12 2019 +0200
     3.3 @@ -51,7 +51,7 @@
     3.4          defer { objc_sync_exit(self) }
     3.5  
     3.6          guard isValidIndex(index) else {
     3.7 -            Logger.frontendLogger.errorAndCrash("Index out of range")
     3.8 +            Log.shared.errorAndCrash("Index out of range")
     3.9              return
    3.10          }
    3.11          set.removeObject(at: index)
    3.12 @@ -62,7 +62,7 @@
    3.13          defer { objc_sync_exit(self) }
    3.14  
    3.15          guard isValidIndex(index) else {
    3.16 -            Logger.frontendLogger.errorAndCrash("Index out of range")
    3.17 +            Log.shared.errorAndCrash("Index out of range")
    3.18              return
    3.19          }
    3.20          set.replaceObject(at: index, with: object)
    3.21 @@ -73,7 +73,7 @@
    3.22          defer { objc_sync_exit(self) }
    3.23  
    3.24          guard isValidIndex(index) else {
    3.25 -            Logger.frontendLogger.errorAndCrash("Index out of range")
    3.26 +            Log.shared.errorAndCrash("Index out of range")
    3.27              return nil
    3.28          }
    3.29  
    3.30 @@ -101,7 +101,7 @@
    3.31  
    3.32          for i in 0..<set.count {
    3.33              guard let testee = set.object(at: i) as? T else {
    3.34 -                Logger.frontendLogger.errorAndCrash("error casting")
    3.35 +                Log.shared.errorAndCrash("error casting")
    3.36                  return NSNotFound
    3.37              }
    3.38              if testee == object {
    3.39 @@ -187,7 +187,7 @@
    3.40          set.sort { (first: Any, second: Any) -> ComparisonResult in
    3.41              guard let firstT = first as? T,
    3.42                  let secondT = second as? T else {
    3.43 -                    Logger.frontendLogger.errorAndCrash("Error casting.")
    3.44 +                    Log.shared.errorAndCrash("Error casting.")
    3.45                      return .orderedSame
    3.46              }
    3.47              return sortBlock(firstT, secondT)
    3.48 @@ -197,7 +197,7 @@
    3.49      private func indexOfObjectIfInserted(obj: T) -> Int {
    3.50          for i in 0..<set.count {
    3.51              guard let testee = set.object(at: i) as? T else {
    3.52 -                Logger.frontendLogger.errorAndCrash("Error casing")
    3.53 +                Log.shared.errorAndCrash("Error casing")
    3.54                  return 0
    3.55              }
    3.56              if set.count == 0 {
     4.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Wed May 08 12:23:41 2019 +0200
     4.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Fri May 10 10:50:12 2019 +0200
     4.3 @@ -190,6 +190,7 @@
     4.4  		220DCE371E0AB5CC002FE716 /* MessageSubjectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 220DCE331E0AB5CC002FE716 /* MessageSubjectCell.swift */; };
     4.5  		222B35581DF96389007A1F82 /* Capability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 222B35571DF96389007A1F82 /* Capability.swift */; };
     4.6  		228038681DC9DE6D00F1CB45 /* TextfieldResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 228038671DC9DE6D00F1CB45 /* TextfieldResponder.swift */; };
     4.7 +		37C3C0E62260C64D003E290C /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C3C0E52260C64D003E290C /* Log.swift */; };
     4.8  		43040A531E9776220083DED8 /* AttachmentSummaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43040A521E9776220083DED8 /* AttachmentSummaryView.swift */; };
     4.9  		4304FD001EBB8EBB0086DADA /* LanguageListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4304FCFE1EBB8C5A0086DADA /* LanguageListViewController.swift */; };
    4.10  		430BA229203438A3003B041C /* CdMessagePEPMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430BA228203438A3003B041C /* CdMessagePEPMessageTests.swift */; };
    4.11 @@ -420,8 +421,6 @@
    4.12  		A1014DA71D1173CD00C472A8 /* UIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 436C5A8D1CFEDF59006A195F /* UIHelper.swift */; };
    4.13  		A1B50A841CD26FF100B1A997 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1B50A811CD26FF100B1A997 /* Constants.swift */; };
    4.14  		B70A3A63220065F600EDCE61 /* String+pEp.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A62220065F500EDCE61 /* String+pEp.swift */; };
    4.15 -		B70A3A9322089D5000EDCE61 /* Log+ASL.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A9122089D5000EDCE61 /* Log+ASL.swift */; };
    4.16 -		B70A3A9422089D5000EDCE61 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A9222089D5000EDCE61 /* Log.swift */; };
    4.17  		B70A3C401E817CFA0036876F /* FolderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3C3F1E817CFA0036876F /* FolderViewModel.swift */; };
    4.18  		B716056020D3ECC900A733D6 /* MoveToFolderTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B716055F20D3ECC900A733D6 /* MoveToFolderTableViewController.swift */; };
    4.19  		B71EBBBC1E55E4AE00150177 /* FolderTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B71EBBBB1E55E4AE00150177 /* FolderTableViewController.swift */; };
    4.20 @@ -677,6 +676,7 @@
    4.21  		220DCE331E0AB5CC002FE716 /* MessageSubjectCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MessageSubjectCell.swift; sourceTree = "<group>"; };
    4.22  		222B35571DF96389007A1F82 /* Capability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capability.swift; sourceTree = "<group>"; };
    4.23  		228038671DC9DE6D00F1CB45 /* TextfieldResponder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextfieldResponder.swift; sourceTree = "<group>"; };
    4.24 +		37C3C0E52260C64D003E290C /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
    4.25  		43040A521E9776220083DED8 /* AttachmentSummaryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentSummaryView.swift; sourceTree = "<group>"; };
    4.26  		4304FCFE1EBB8C5A0086DADA /* LanguageListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageListViewController.swift; sourceTree = "<group>"; };
    4.27  		430BA228203438A3003B041C /* CdMessagePEPMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CdMessagePEPMessageTests.swift; sourceTree = "<group>"; };
    4.28 @@ -941,8 +941,6 @@
    4.29  		8B69E3981E30F80E0022959E /* Appearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Appearance.swift; sourceTree = "<group>"; };
    4.30  		A1B50A811CD26FF100B1A997 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
    4.31  		B70A3A62220065F500EDCE61 /* String+pEp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+pEp.swift"; sourceTree = "<group>"; };
    4.32 -		B70A3A9122089D5000EDCE61 /* Log+ASL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Log+ASL.swift"; sourceTree = "<group>"; };
    4.33 -		B70A3A9222089D5000EDCE61 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
    4.34  		B70A3C3F1E817CFA0036876F /* FolderViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FolderViewModel.swift; path = Folder/ViewModel/FolderViewModel.swift; sourceTree = "<group>"; };
    4.35  		B716055F20D3ECC900A733D6 /* MoveToFolderTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoveToFolderTableViewController.swift; sourceTree = "<group>"; };
    4.36  		B71EBBBB1E55E4AE00150177 /* FolderTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FolderTableViewController.swift; path = Folder/FolderTableViewController.swift; sourceTree = "<group>"; };
    4.37 @@ -1901,7 +1899,6 @@
    4.38  		43980EDE1CBD24B000A7FC3C /* Util */ = {
    4.39  			isa = PBXGroup;
    4.40  			children = (
    4.41 -				B70A3A9022089D3C00EDCE61 /* Log */,
    4.42  				4362398D1EAE08F400BD2EB9 /* Extensions */,
    4.43  				B740B7571E4B1B80002585E1 /* MimeTypes */,
    4.44  				43306EBC1FE125950045DD00 /* OAuth2 */,
    4.45 @@ -2041,6 +2038,8 @@
    4.46  		43E58EB21CBF8301008AA7A7 /* Models */ = {
    4.47  			isa = PBXGroup;
    4.48  			children = (
    4.49 +				37C3C0E52260C64D003E290C /* Log.swift */,
    4.50 +				15F835231F34BE1300FCE887 /* AccountUserInput.swift */,
    4.51  				4365E868226615E400929D07 /* VerifiableAccount */,
    4.52  				43CE63C41DE87FB200FAC505 /* Identity+pEp.swift */,
    4.53  				155475632137FD96005A52D0 /* FolderType+Extensions.swift */,
    4.54 @@ -2251,15 +2250,6 @@
    4.55  			path = ..;
    4.56  			sourceTree = "<group>";
    4.57  		};
    4.58 -		B70A3A9022089D3C00EDCE61 /* Log */ = {
    4.59 -			isa = PBXGroup;
    4.60 -			children = (
    4.61 -				B70A3A9122089D5000EDCE61 /* Log+ASL.swift */,
    4.62 -				B70A3A9222089D5000EDCE61 /* Log.swift */,
    4.63 -			);
    4.64 -			path = Log;
    4.65 -			sourceTree = "<group>";
    4.66 -		};
    4.67  		B70D32A5205BCC020094A92A /* ViewModel */ = {
    4.68  			isa = PBXGroup;
    4.69  			children = (
    4.70 @@ -2936,6 +2926,7 @@
    4.71  				43D5411B2268853A00E74427 /* VerifiableAccountProtocol+UI.swift in Sources */,
    4.72  				152A39DD21905C3E00D9F8E4 /* AccountCell.swift in Sources */,
    4.73  				B7DB7FDC221ADDBD003968DA /* UIImageView+Extension.swift in Sources */,
    4.74 +				37C3C0E62260C64D003E290C /* Log.swift in Sources */,
    4.75  				43306EC21FE129840045DD00 /* OAuth2Type.swift in Sources */,
    4.76  				438052871FE3E1B100ACF729 /* OAuth2AuthorizationFactoryProtocol.swift in Sources */,
    4.77  				4356FFE52135448600804089 /* ReplyAllPossibleChecker.swift in Sources */,
    4.78 @@ -2980,7 +2971,6 @@
    4.79  				43A6E0581E57400E005BEE69 /* RatingReEvaluator.swift in Sources */,
    4.80  				49C34AF620E4F649009D11CC /* CellDetailTransition.swift in Sources */,
    4.81  				492EF92A20C18C6C004EAE14 /* DisplayedMessage.swift in Sources */,
    4.82 -				B70A3A9322089D5000EDCE61 /* Log+ASL.swift in Sources */,
    4.83  				49228A5520D4035100A51E9D /* DetailCellSegue.swift in Sources */,
    4.84  				43497B38211C62DE00AC42B0 /* MessageIdentitfying.swift in Sources */,
    4.85  				00FD0CE82102014C00BA0C56 /* PrimarySplitViewcontroller+ScreenComposerProtocol.swift in Sources */,
     5.1 --- a/pEpForiOS/AppDelegate.swift	Wed May 08 12:23:41 2019 +0200
     5.2 +++ b/pEpForiOS/AppDelegate.swift	Fri May 10 10:50:12 2019 +0200
     5.3 @@ -53,7 +53,7 @@
     5.4  
     5.5      private func setupInitialViewController() -> Bool {
     5.6          guard let appConfig = appConfig else {
     5.7 -            Logger.appDelegateLogger.errorAndCrash("No AppConfig")
     5.8 +            Log.shared.errorAndCrash("No AppConfig")
     5.9              return false
    5.10          }
    5.11          let mainStoryboard: UIStoryboard = UIStoryboard(name: "FolderViews", bundle: nil)
    5.12 @@ -61,7 +61,7 @@
    5.13              let navController = initialNVC.viewControllers.first as? UINavigationController,
    5.14              let rootVC = navController.rootViewController as? FolderTableViewController
    5.15              else {
    5.16 -                Logger.appDelegateLogger.errorAndCrash("Problem initializing UI")
    5.17 +                Log.shared.errorAndCrash("Problem initializing UI")
    5.18                  return false
    5.19          }
    5.20          rootVC.appConfig = appConfig
    5.21 @@ -85,7 +85,7 @@
    5.22      private func stopUsingPepSession() {
    5.23          syncUserActionsAndCleanupbackgroundTaskId =
    5.24              application.beginBackgroundTask(expirationHandler: { [unowned self] in
    5.25 -                Logger.appDelegateLogger.errorAndCrash(
    5.26 +                Log.shared.errorAndCrash(
    5.27                      "syncUserActionsAndCleanupbackgroundTask with ID %{public}@ expired",
    5.28                      self.syncUserActionsAndCleanupbackgroundTaskId as CVarArg)
    5.29                  // We migh want to call some (yet unexisting) emergency shutdown on
    5.30 @@ -104,7 +104,7 @@
    5.31  
    5.32      func kickOffMySelf() {
    5.33          mySelfTaskId = application.beginBackgroundTask(expirationHandler: { [unowned self] in
    5.34 -            Logger.appDelegateLogger.log("mySelfTaskId with ID expired.")
    5.35 +            Log.shared.log("mySelfTaskId with ID expired.")
    5.36              // We migh want to call some (yet unexisting) emergency shutdown on
    5.37              // ReplicationService here here that brutally shuts down everything.
    5.38              self.application.endBackgroundTask(
    5.39 @@ -133,7 +133,7 @@
    5.40                                           storeURL: nil,
    5.41                                           options: options)
    5.42          } catch {
    5.43 -            Logger.appDelegateLogger.errorAndCrash("Error while Loading DataStack")
    5.44 +            Log.shared.errorAndCrash("Error while Loading DataStack")
    5.45          }
    5.46      }
    5.47  
    5.48 @@ -216,7 +216,7 @@
    5.49      // MARK: - UIApplicationDelegate
    5.50  
    5.51      func applicationDidReceiveMemoryWarning(_ application: UIApplication) {
    5.52 -        Logger.appDelegateLogger.log("applicationDidReceiveMemoryWarning")
    5.53 +        Log.shared.log("applicationDidReceiveMemoryWarning")
    5.54      }
    5.55  
    5.56      func application(
    5.57 @@ -236,7 +236,7 @@
    5.58          let pEpReInitialized = deleteManagementDBIfRequired()
    5.59  
    5.60          setupServices()
    5.61 -        Logger.appDelegateLogger.log("Library url: %{public}@", String(describing: applicationDirectory()))
    5.62 +        Log.shared.log("Library url: %{public}@", String(describing: applicationDirectory()))
    5.63          deleteAllFolders(pEpReInitialized: pEpReInitialized)
    5.64  
    5.65          prepareUserNotifications()
    5.66 @@ -298,7 +298,7 @@
    5.67          completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
    5.68          
    5.69          guard let messageModelService = messageModelService else {
    5.70 -            Logger.appDelegateLogger.error("no replicationService")
    5.71 +            Log.shared.error("no networkService")
    5.72              return
    5.73          }
    5.74          
     6.1 --- a/pEpForiOS/Base.lproj/Main.storyboard	Wed May 08 12:23:41 2019 +0200
     6.2 +++ b/pEpForiOS/Base.lproj/Main.storyboard	Fri May 10 10:50:12 2019 +0200
     6.3 @@ -1,11 +1,11 @@
     6.4  <?xml version="1.0" encoding="UTF-8"?>
     6.5 -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="wwj-Sj-78N">
     6.6 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="wwj-Sj-78N">
     6.7      <device id="retina4_7" orientation="portrait">
     6.8          <adaptation id="fullscreen"/>
     6.9      </device>
    6.10      <dependencies>
    6.11          <deployment identifier="iOS"/>
    6.12 -        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
    6.13 +        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
    6.14          <capability name="Safe area layout guides" minToolsVersion="9.0"/>
    6.15          <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    6.16      </dependencies>
    6.17 @@ -107,7 +107,7 @@
    6.18                                              </subviews>
    6.19                                          </stackView>
    6.20                                          <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" image="pEp-status-yellow" translatesAutoresizingMaskIntoConstraints="NO" id="m0u-Jn-mQU">
    6.21 -                                            <rect key="frame" x="56" y="52.5" width="20" height="20"/>
    6.22 +                                            <rect key="frame" x="60" y="56.5" width="16" height="16"/>
    6.23                                              <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
    6.24                                              <constraints>
    6.25                                                  <constraint firstAttribute="width" secondItem="m0u-Jn-mQU" secondAttribute="height" multiplier="1:1" id="7pr-8F-BtP"/>
    6.26 @@ -360,19 +360,19 @@
    6.27                                      <rect key="frame" x="0.0" y="0.0" width="375" height="72"/>
    6.28                                      <autoresizingMask key="autoresizingMask"/>
    6.29                                      <subviews>
    6.30 -                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Sender" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hnw-Tp-mga">
    6.31 +                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" ambiguous="YES" text="Sender" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hnw-Tp-mga">
    6.32                                              <rect key="frame" x="20" y="11" width="331" height="30"/>
    6.33                                              <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="15"/>
    6.34                                              <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
    6.35                                              <nil key="highlightedColor"/>
    6.36                                          </label>
    6.37 -                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To: Recipients" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mfx-AS-hpP">
    6.38 +                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="To: Recipients" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mfx-AS-hpP">
    6.39                                              <rect key="frame" x="20" y="45" width="331" height="18"/>
    6.40                                              <fontDescription key="fontDescription" type="system" pointSize="15"/>
    6.41                                              <nil key="textColor"/>
    6.42                                              <nil key="highlightedColor"/>
    6.43                                          </label>
    6.44 -                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="252" image="separator_pixel_grey" translatesAutoresizingMaskIntoConstraints="NO" id="Gbh-o3-H58">
    6.45 +                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="252" ambiguous="YES" image="separator_pixel_grey" translatesAutoresizingMaskIntoConstraints="NO" id="Gbh-o3-H58">
    6.46                                              <rect key="frame" x="10" y="71" width="355" height="1"/>
    6.47                                          </imageView>
    6.48                                      </subviews>
    6.49 @@ -784,7 +784,7 @@
    6.50                                                      <color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="calibratedWhite"/>
    6.51                                                      <nil key="highlightedColor"/>
    6.52                                                  </label>
    6.53 -                                                <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3ee-yP-4gA" customClass="SubjectComposeTextView" customModule="pEpForiOS" customModuleProvider="target">
    6.54 +                                                <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3ee-yP-4gA">
    6.55                                                      <rect key="frame" x="60" y="23" width="295" height="34.5"/>
    6.56                                                      <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
    6.57                                                      <fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
     7.1 --- a/pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift	Wed May 08 12:23:41 2019 +0200
     7.2 +++ b/pEpForiOS/HTMLParser/Axt/HtmlToMarkdownSaxParser.swift	Fri May 10 10:50:12 2019 +0200
     7.3 @@ -62,6 +62,6 @@
     7.4      }
     7.5  
     7.6      func parser(_ parser: AXHTMLParser, parseErrorOccurred parseError: Error) {
     7.7 -        Logger.htmlParsingLogger.errorAndCrash("%@", parseError.localizedDescription)
     7.8 +        Log.shared.errorAndCrash("%@", parseError.localizedDescription)
     7.9      }
    7.10  }
     8.1 --- a/pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift	Wed May 08 12:23:41 2019 +0200
     8.2 +++ b/pEpForiOS/HTMLParser/Axt/HtmlToTextSaxParser.swift	Fri May 10 10:50:12 2019 +0200
     8.3 @@ -60,6 +60,6 @@
     8.4      }
     8.5  
     8.6      func parser(_ parser: AXHTMLParser, parseErrorOccurred parseError: Error) {
     8.7 -        Logger.htmlParsingLogger.error("%@", parseError.localizedDescription)
     8.8 +        Log.shared.error("%@", parseError.localizedDescription)
     8.9      }
    8.10  }
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/pEpForiOS/Models/Log.swift	Fri May 10 10:50:12 2019 +0200
     9.3 @@ -0,0 +1,18 @@
     9.4 +//
     9.5 +//  Log.swift
     9.6 +//  pEp
     9.7 +//
     9.8 +//  Created by Alejandro Gelos on 12/04/2019.
     9.9 +//  Copyright © 2019 p≡p Security S.A. All rights reserved.
    9.10 +//
    9.11 +
    9.12 +import pEpIOSToolbox
    9.13 +
    9.14 +/// Shared instance of logger.
    9.15 +class Log {
    9.16 +    static let shared = Logger(subsystem: "security.pEp.pEpForiOS", category: "pEpForiOS")
    9.17 +
    9.18 +    /// Init is forbidden. Singleton...
    9.19 +    private init() {}
    9.20 +}
    9.21 +
    10.1 --- a/pEpForiOS/UI/Background/ReevaluateMessageRatingOperation.swift	Wed May 08 12:23:41 2019 +0200
    10.2 +++ b/pEpForiOS/UI/Background/ReevaluateMessageRatingOperation.swift	Fri May 10 10:50:12 2019 +0200
    10.3 @@ -61,7 +61,7 @@
    10.4              context.saveAndLogErrors()
    10.5              message.pEpRatingInt = Int(newRating.rawValue)
    10.6          } catch let error as NSError {
    10.7 -            Logger.backendLogger.log(error: error)
    10.8 +            Log.shared.log(error: error)
    10.9          }
   10.10      }
   10.11  }
    11.1 --- a/pEpForiOS/UI/Compose/Cells/AccountCell/AccountCell.swift	Wed May 08 12:23:41 2019 +0200
    11.2 +++ b/pEpForiOS/UI/Compose/Cells/AccountCell/AccountCell.swift	Fri May 10 10:50:12 2019 +0200
    11.3 @@ -31,7 +31,7 @@
    11.4  
    11.5      private func setupPickerView() {
    11.6          guard let viewModel = viewModel else {
    11.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    11.8 +            Log.shared.errorAndCrash("No VM")
    11.9              return
   11.10          }
   11.11          picker = AccountPickerView()
    12.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Wed May 08 12:23:41 2019 +0200
    12.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCell.swift	Fri May 10 10:50:12 2019 +0200
    12.3 @@ -26,7 +26,7 @@
    12.4  
    12.5      private func setupInitialText() {
    12.6          guard let vm = viewModel else {
    12.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    12.8 +            Log.shared.errorAndCrash("No VM")
    12.9              return
   12.10          }
   12.11          let (text, attrText) = vm.inititalText()
   12.12 @@ -43,7 +43,7 @@
   12.13      // Set cursor and show keyboard
   12.14      override func setFocus() {
   12.15          guard let vm = viewModel else {
   12.16 -            Logger.frontendLogger.errorAndCrash("No VM")
   12.17 +            Log.shared.errorAndCrash("No VM")
   12.18              return
   12.19          }
   12.20          if let rangeStart = textView.position(from: textView.beginningOfDocument,
   12.21 @@ -101,7 +101,7 @@
   12.22                    shouldChangeTextIn range: NSRange,
   12.23                    replacementText text: String) -> Bool {
   12.24          guard let vm = viewModel else {
   12.25 -            Logger.frontendLogger.errorAndCrash("No VM")
   12.26 +            Log.shared.errorAndCrash("No VM")
   12.27              return true
   12.28          }
   12.29         return vm.shouldReplaceText(in: range, of: textView.attributedText, with: text)
    13.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCellViewModel.swift	Wed May 08 12:23:41 2019 +0200
    13.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/BodyCellViewModel.swift	Fri May 10 10:50:12 2019 +0200
    13.3 @@ -117,7 +117,7 @@
    13.4  extension BodyCellViewModel {
    13.5      public func inline(attachment: Attachment) {
    13.6          guard let image = attachment.image else {
    13.7 -            Logger.frontendLogger.errorAndCrash("No image")
    13.8 +            Log.shared.errorAndCrash("No image")
    13.9              return
   13.10          }
   13.11          attachment.contentDisposition = .inline
   13.12 @@ -125,7 +125,7 @@
   13.13          // performance issues (delay typing).
   13.14          guard let scaledImage = image.resized(newWidth: maxTextattachmentWidth / 2, useAlpha: false)
   13.15              else {
   13.16 -                Logger.frontendLogger.errorAndCrash("Error resizing")
   13.17 +                Log.shared.errorAndCrash("Error resizing")
   13.18                  return
   13.19          }
   13.20          let textAttachment = TextAttachment()
    14.1 --- a/pEpForiOS/UI/Compose/Cells/BodyCell/NSAttributedString+BodyTextUtils.swift	Wed May 08 12:23:41 2019 +0200
    14.2 +++ b/pEpForiOS/UI/Compose/Cells/BodyCell/NSAttributedString+BodyTextUtils.swift	Fri May 10 10:50:12 2019 +0200
    14.3 @@ -16,7 +16,7 @@
    14.4      public func assureMaxTextAttachmentImageWidth(_ maxWidth: CGFloat) {
    14.5          for textAttachment in textAttachments() {
    14.6              guard let image = textAttachment.image else {
    14.7 -                Logger.utilLogger.errorAndCrash("No image?")
    14.8 +                Log.shared.errorAndCrash("No image?")
    14.9                  return
   14.10              }
   14.11              if image.size.width > maxWidth {
    15.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextView.swift	Wed May 08 12:23:41 2019 +0200
    15.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextView.swift	Fri May 10 10:50:12 2019 +0200
    15.3 @@ -48,7 +48,7 @@
    15.4                           shouldChangeTextIn range: NSRange,
    15.5                           replacementText text: String) -> Bool {
    15.6          guard let vm = viewModel else {
    15.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    15.8 +            Log.shared.errorAndCrash("No VM")
    15.9              return true
   15.10          }
   15.11          if vm.isAddressDeliminator(str: text) {
   15.12 @@ -64,7 +64,7 @@
   15.13                      return true
   15.14              }
   15.15              guard let potentiallyReplacedText = textView.text(in: newRange) else {
   15.16 -                Logger.frontendLogger.errorAndCrash("Invalid state")
   15.17 +                Log.shared.errorAndCrash("Invalid state")
   15.18                  return true
   15.19              }
   15.20              // Check if text is Attachment and select it
   15.21 @@ -89,7 +89,7 @@
   15.22                    shouldInteractWith textAttachment: NSTextAttachment,
   15.23                    in characterRange: NSRange) -> 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 true
   15.28          }
   15.29          return vm.shouldInteract(with: textAttachment)
    16.1 --- a/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Wed May 08 12:23:41 2019 +0200
    16.2 +++ b/pEpForiOS/UI/Compose/Cells/RecipientCell/RecipientTextView/RecipientTextViewModel+TextAttachment.swift	Fri May 10 10:50:12 2019 +0200
    16.3 @@ -79,7 +79,7 @@
    16.4                        attributes: attributes, context: nil)
    16.5  
    16.6              guard let createe = UIGraphicsGetImageFromCurrentImageContext() else {
    16.7 -                Logger.frontendLogger.errorAndCrash("No img")
    16.8 +                Log.shared.errorAndCrash("No img")
    16.9                  return
   16.10              }
   16.11              UIGraphicsEndImageContext()
    17.1 --- a/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    17.2 +++ b/pEpForiOS/UI/Compose/ComposeTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    17.3 @@ -19,7 +19,7 @@
    17.4      private var suggestionsChildViewController: SuggestTableViewController?
    17.5      lazy private var mediaAttachmentPickerProvider: MediaAttachmentPickerProvider? = {
    17.6          guard let pickerVm = viewModel?.mediaAttachmentPickerProviderViewModel() else {
    17.7 -            Logger.frontendLogger.errorAndCrash("Invalid state")
    17.8 +            Log.shared.errorAndCrash("Invalid state")
    17.9              return nil
   17.10          }
   17.11          return MediaAttachmentPickerProvider(with: pickerVm)
   17.12 @@ -75,7 +75,7 @@
   17.13                  withIdentifier: SuggestTableViewController.storyboardId)
   17.14                  as? SuggestTableViewController,
   17.15              let suggestView = suggestVc.view else {
   17.16 -                Logger.frontendLogger.errorAndCrash("No VC.")
   17.17 +                Log.shared.errorAndCrash("No VC.")
   17.18                  return
   17.19          }
   17.20          suggestionsChildViewController = suggestVc
   17.21 @@ -111,7 +111,7 @@
   17.22  extension ComposeTableViewController {
   17.23      private func setupPepColorView(for pEpRating: PEPRating, pEpProtected: Bool) {
   17.24          guard let vm = viewModel else {
   17.25 -            Logger.frontendLogger.errorAndCrash("No VM")
   17.26 +            Log.shared.errorAndCrash("No VM")
   17.27              return
   17.28          }
   17.29  
   17.30 @@ -129,7 +129,7 @@
   17.31      /// Shows a menu where user can choose to make a handshake, or toggle force unprotected.
   17.32      @objc func actionHandshakeOrForceUnprotected(gestureRecognizer: UITapGestureRecognizer) {
   17.33          guard let vm = viewModel else {
   17.34 -            Logger.frontendLogger.errorAndCrash("No VM")
   17.35 +            Log.shared.errorAndCrash("No VM")
   17.36              return
   17.37          }
   17.38          let theCanHandshake = vm.state.canHandshake()
   17.39 @@ -284,7 +284,7 @@
   17.40              guard
   17.41                  let nc = segue.destination as? UINavigationController,
   17.42                  let destination = nc.rootViewController as? HandshakeViewController else {
   17.43 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
   17.44 +                    Log.shared.errorAndCrash("Segue issue")
   17.45                      return
   17.46              }
   17.47              destination.appConfig = appConfig
   17.48 @@ -318,7 +318,7 @@
   17.49              }
   17.50              guard let me = self,
   17.51              let picker = me.mediaAttachmentPickerProvider?.imagePicker else {
   17.52 -                Logger.frontendLogger.errorAndCrash("Lost somthing")
   17.53 +                Log.shared.errorAndCrash("Lost somthing")
   17.54                  return
   17.55              }
   17.56              me.present(picker, animated: true)
   17.57 @@ -340,7 +340,7 @@
   17.58      
   17.59      override func numberOfSections(in tableView: UITableView) -> Int {
   17.60          guard let vm = viewModel else {
   17.61 -            Logger.frontendLogger.errorAndCrash("No VM")
   17.62 +            Log.shared.errorAndCrash("No VM")
   17.63              return 0
   17.64          }
   17.65          return vm.sections.count
   17.66 @@ -349,7 +349,7 @@
   17.67      override func tableView(_ tableView: UITableView,
   17.68                              numberOfRowsInSection section: Int) -> Int {
   17.69          guard let vm = viewModel else {
   17.70 -            Logger.frontendLogger.errorAndCrash("No VM")
   17.71 +            Log.shared.errorAndCrash("No VM")
   17.72              return 0
   17.73          }
   17.74          return vm.sections[section].rows.count
   17.75 @@ -358,7 +358,7 @@
   17.76      override func tableView(_ tableView: UITableView,
   17.77                              cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   17.78          guard let cell = setupCellForIndexPath(indexPath, in: tableView) else {
   17.79 -            Logger.frontendLogger.errorAndCrash("No cell")
   17.80 +            Log.shared.errorAndCrash("No cell")
   17.81              return UITableViewCell()
   17.82          }
   17.83          return cell
   17.84 @@ -367,7 +367,7 @@
   17.85      private func setupCellForIndexPath(_ indexPath: IndexPath,
   17.86                                    in tableView: UITableView) -> UITableViewCell? {
   17.87          guard let vm = viewModel else {
   17.88 -            Logger.frontendLogger.errorAndCrash("No VM")
   17.89 +            Log.shared.errorAndCrash("No VM")
   17.90              return UITableViewCell()
   17.91          }
   17.92  
   17.93 @@ -380,7 +380,7 @@
   17.94                      as? RecipientCell,
   17.95                  let rowVm = section.rows[indexPath.row] as? RecipientCellViewModel
   17.96                  else {
   17.97 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
   17.98 +                    Log.shared.errorAndCrash("Invalid state")
   17.99                      return nil
  17.100              }
  17.101              cell.setup(with: rowVm)
  17.102 @@ -393,7 +393,7 @@
  17.103                      as? AccountCell,
  17.104                  let rowVm = section.rows[indexPath.row] as? AccountCellViewModel
  17.105                  else {
  17.106 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  17.107 +                    Log.shared.errorAndCrash("Invalid state")
  17.108                      return nil
  17.109              }
  17.110              cell.setup(with: rowVm)
  17.111 @@ -404,7 +404,7 @@
  17.112                          as? SubjectCell,
  17.113                      let rowVm = section.rows[indexPath.row] as? SubjectCellViewModel
  17.114                      else {
  17.115 -                        Logger.frontendLogger.errorAndCrash("Invalid state")
  17.116 +                        Log.shared.errorAndCrash("Invalid state")
  17.117                      return nil
  17.118              }
  17.119              cell.setup(with: rowVm)
  17.120 @@ -415,7 +415,7 @@
  17.121                      as? BodyCell,
  17.122                  let rowVm = section.rows[indexPath.row] as? BodyCellViewModel
  17.123                  else {
  17.124 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  17.125 +                    Log.shared.errorAndCrash("Invalid state")
  17.126                      return nil
  17.127              }
  17.128              cell.setup(with: rowVm)
  17.129 @@ -426,7 +426,7 @@
  17.130                      as? AttachmentCell,
  17.131                  let rowVm = section.rows[indexPath.row] as? AttachmentViewModel
  17.132                  else {
  17.133 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  17.134 +                    Log.shared.errorAndCrash("Invalid state")
  17.135                      return nil
  17.136              }
  17.137              cell.setup(with: rowVm)
  17.138 @@ -482,7 +482,7 @@
  17.139          let deleteAction = SwipeAction(style: .destructive, title: "Delete") {
  17.140              [weak self] action, indexPath in
  17.141              guard let me = self else {
  17.142 -                Logger.frontendLogger.lostMySelf()
  17.143 +                Log.shared.errorAndCrash("Lost MySelf")
  17.144                  return
  17.145              }
  17.146              me.deleteAction(forCellAt: indexPath)
  17.147 @@ -501,7 +501,7 @@
  17.148              // The last cell is not yet displayed (as we are in "willDisplay ..."), thus async.
  17.149              DispatchQueue.main.async { [weak self] in
  17.150                  guard let me = self else {
  17.151 -                    Logger.frontendLogger.lostMySelf()
  17.152 +                    Log.shared.errorAndCrash("Lost MySelf")
  17.153                      return
  17.154                  }
  17.155                  me.setInitialFocus()
  17.156 @@ -521,7 +521,7 @@
  17.157          }
  17.158          isInitialFocusSet = true
  17.159          guard let vm = viewModel else {
  17.160 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.161 +            Log.shared.errorAndCrash("No VM")
  17.162              return
  17.163          }
  17.164          let idxPath = vm.initialFocus()
  17.165 @@ -535,13 +535,13 @@
  17.166  
  17.167      private func setPreviousFocusAfterPicker() {
  17.168          guard let vm = viewModel else {
  17.169 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.170 +            Log.shared.errorAndCrash("No VM")
  17.171              return
  17.172          }
  17.173          let idxPath = vm.beforePickerFocus()
  17.174          guard let cellToFocus = tableView.cellForRow(at: idxPath)
  17.175              as? TextViewContainingTableViewCell else {
  17.176 -                Logger.frontendLogger.errorAndCrash("Error casting")
  17.177 +                Log.shared.errorAndCrash("Error casting")
  17.178                  return
  17.179          }
  17.180          cellToFocus.setFocus()
  17.181 @@ -549,7 +549,7 @@
  17.182  
  17.183      private func isLastRow(indexPath: IndexPath) -> Bool {
  17.184          guard let vm = viewModel else {
  17.185 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.186 +            Log.shared.errorAndCrash("No VM")
  17.187              return false
  17.188          }
  17.189          let idxLastSection = vm.sections.count - 1
  17.190 @@ -579,14 +579,14 @@
  17.191  
  17.192      private func deleteAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  17.193          guard let vm = viewModel else {
  17.194 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.195 +            Log.shared.errorAndCrash("No VM")
  17.196              return UIAlertAction()
  17.197          }
  17.198          let action: UIAlertAction
  17.199          let text = vm.deleteActionTitle
  17.200          action = ac.action(text, .destructive) {[weak self] in
  17.201              guard let me = self else {
  17.202 -                Logger.frontendLogger.lostMySelf()
  17.203 +                Log.shared.errorAndCrash("Lost MySelf")
  17.204                  return
  17.205              }
  17.206              vm.handleDeleteActionTriggered()
  17.207 @@ -597,14 +597,14 @@
  17.208  
  17.209      private func saveAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  17.210          guard let vm = viewModel else {
  17.211 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.212 +            Log.shared.errorAndCrash("No VM")
  17.213              return UIAlertAction()
  17.214          }
  17.215          let action: UIAlertAction
  17.216          let text = vm.saveActionTitle
  17.217          action = ac.action(text, .default) { [weak self] in
  17.218              guard let me = self else {
  17.219 -                Logger.frontendLogger.lostMySelf()
  17.220 +                Log.shared.errorAndCrash("Lost MySelf")
  17.221                  return
  17.222              }
  17.223              vm.handleSaveActionTriggered()
  17.224 @@ -615,14 +615,14 @@
  17.225  
  17.226      private func keepInOutboxAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  17.227          guard let vm = viewModel else {
  17.228 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.229 +            Log.shared.errorAndCrash("No VM")
  17.230              return UIAlertAction()
  17.231          }
  17.232          let action: UIAlertAction
  17.233          let text = vm.keepInOutboxActionTitle
  17.234          action = ac.action(text, .default) {[weak self] in
  17.235              guard let me = self else {
  17.236 -                Logger.frontendLogger.lostMySelf()
  17.237 +                Log.shared.errorAndCrash("Lost MySelf")
  17.238                  return
  17.239              }
  17.240              me.dismiss()
  17.241 @@ -632,7 +632,7 @@
  17.242  
  17.243      private func cancelAction(forAlertController ac: UIAlertController) -> UIAlertAction {
  17.244          guard let vm = viewModel else {
  17.245 -            Logger.frontendLogger.errorAndCrash("No VM")
  17.246 +            Log.shared.errorAndCrash("No VM")
  17.247              return UIAlertAction()
  17.248          }
  17.249          return ac.action(vm.cancelActionTitle, .cancel)
    18.1 --- a/pEpForiOS/UI/Compose/Util/ComposeUtil.swift	Wed May 08 12:23:41 2019 +0200
    18.2 +++ b/pEpForiOS/UI/Compose/Util/ComposeUtil.swift	Fri May 10 10:50:12 2019 +0200
    18.3 @@ -36,7 +36,7 @@
    18.4                  result = om.to
    18.5              } else if om.parent.folderType != .sent, let omFrom = om.from {
    18.6                  guard let me = initialFrom(composeMode: composeMode, originalMessage: om) else {
    18.7 -                    Logger.utilLogger.errorAndCrash("No from")
    18.8 +                    Log.shared.errorAndCrash("No from")
    18.9                      return result
   18.10                  }
   18.11                  let origTos = om.to
   18.12 @@ -63,7 +63,7 @@
   18.13                  result = om.cc
   18.14              } else {
   18.15                  guard let me = initialFrom(composeMode: composeMode, originalMessage: om) else {
   18.16 -                    Logger.utilLogger.errorAndCrash("No from")
   18.17 +                    Log.shared.errorAndCrash("No from")
   18.18                      return result
   18.19                  }
   18.20                  let origCcs = om.cc
   18.21 @@ -147,12 +147,12 @@
   18.22          withDataFrom state: ComposeViewModel.ComposeViewModelState) -> Message? {
   18.23          guard let from = state.from,
   18.24              let account = Account.by(address: from.address) else {
   18.25 -                Logger.frontendLogger.errorAndCrash(
   18.26 +                Log.shared.errorAndCrash(
   18.27                      "We have a problem here getting the senders account.")
   18.28                  return nil
   18.29          }
   18.30          guard let f = Folder.by(account: account, folderType: .outbox) else {
   18.31 -            Logger.utilLogger.errorAndCrash("No outbox")
   18.32 +            Log.shared.errorAndCrash("No outbox")
   18.33              return nil
   18.34          }
   18.35  
   18.36 @@ -191,7 +191,7 @@
   18.37                                           accordingTo composeState:
   18.38          ComposeViewModel.ComposeViewModelState) {
   18.39          guard let composeMode = composeState.initData?.composeMode else {
   18.40 -            Logger.utilLogger.errorAndCrash("No init data")
   18.41 +            Log.shared.errorAndCrash("No init data")
   18.42              return
   18.43          }
   18.44          if composeMode == .replyFrom || composeMode == .replyAll,
    19.1 --- a/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Wed May 08 12:23:41 2019 +0200
    19.2 +++ b/pEpForiOS/UI/Compose/Util/DocumentAttachmentPickerViewController/DocumentAttachmentPickerViewModel.swift	Fri May 10 10:50:12 2019 +0200
    19.3 @@ -31,11 +31,11 @@
    19.4              createAttachment(forSecurityScopedResource: url) {
    19.5                  [weak self] (attachment: Attachment?) in
    19.6                  guard let me = self else {
    19.7 -                    Logger.frontendLogger.lostMySelf()
    19.8 +                    Log.shared.errorAndCrash("Lost MySelf")
    19.9                      return
   19.10                  }
   19.11                  guard let safeAttachment = attachment else {
   19.12 -                    Logger.frontendLogger.errorAndCrash("No attachment")
   19.13 +                    Log.shared.errorAndCrash("No attachment")
   19.14                      return
   19.15                  }
   19.16                  GCD.onMain {
   19.17 @@ -63,7 +63,7 @@
   19.18              CFURLStartAccessingSecurityScopedResource(cfUrl)
   19.19              defer { CFURLStopAccessingSecurityScopedResource(cfUrl) }
   19.20              guard  let resourceData = try? Data(contentsOf: resourceUrl)  else {
   19.21 -                Logger.frontendLogger.errorAndCrash("No data for URL.")
   19.22 +                Log.shared.errorAndCrash("No data for URL.")
   19.23                  completion(nil)
   19.24                  return
   19.25              }
    20.1 --- a/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Wed May 08 12:23:41 2019 +0200
    20.2 +++ b/pEpForiOS/UI/Compose/Util/MediaAttachmentPickerProvider/MediaAttachmentPickerProviderViewModel.swift	Fri May 10 10:50:12 2019 +0200
    20.3 @@ -48,7 +48,7 @@
    20.4          guard
    20.5              let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage,
    20.6              let url = info[UIImagePickerController.InfoKey.referenceURL] as? URL else {
    20.7 -                Logger.frontendLogger.errorAndCrash("No Data")
    20.8 +                Log.shared.errorAndCrash("No Data")
    20.9                  return
   20.10          }
   20.11  
   20.12 @@ -59,17 +59,17 @@
   20.13  
   20.14      private func createMovieAttchmentAndInformResultDelegate(info: [UIImagePickerController.InfoKey: Any]) {
   20.15          guard let url = info[UIImagePickerController.InfoKey.mediaURL] as? URL else {
   20.16 -            Logger.frontendLogger.errorAndCrash("No URL")
   20.17 +            Log.shared.errorAndCrash("No URL")
   20.18              return
   20.19          }
   20.20  
   20.21          createAttachment(forResource: url) {[weak self] (attachment)  in
   20.22              guard let me = self else {
   20.23 -                Logger.frontendLogger.lostMySelf()
   20.24 +                Log.shared.errorAndCrash("Lost MySelf")
   20.25                  return
   20.26              }
   20.27              guard let att = attachment else {
   20.28 -                Logger.frontendLogger.errorAndCrash("No Attachment")
   20.29 +                Log.shared.errorAndCrash("No Attachment")
   20.30                  return
   20.31              }
   20.32              let result = MediaAttachment(type: .movie, attachment: att)
   20.33 @@ -83,11 +83,11 @@
   20.34                                    completion: @escaping (Attachment?) -> Void) {
   20.35          attachmentFileIOQueue.async { [weak self] in
   20.36              guard let me = self else {
   20.37 -                Logger.frontendLogger.lostMySelf()
   20.38 +                Log.shared.errorAndCrash("Lost MySelf")
   20.39                  return
   20.40              }
   20.41              guard let resourceData = try? Data(contentsOf: resourceUrl) else {
   20.42 -                Logger.frontendLogger.errorAndCrash("Cound not get data for URL")
   20.43 +                Log.shared.errorAndCrash("Cound not get data for URL")
   20.44                  completion(nil)
   20.45                  return
   20.46              }
    21.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Wed May 08 12:23:41 2019 +0200
    21.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Fri May 10 10:50:12 2019 +0200
    21.3 @@ -163,12 +163,12 @@
    21.4          /// Is sutable for isDraftsOrOutbox || composeMode == .forward only.
    21.5          mutating private func setBodyPotetionallyTakingOverAttachments() {
    21.6              guard let msg = originalMessage else {
    21.7 -                Logger.frontendLogger.errorAndCrash("Inconsitant state")
    21.8 +                Log.shared.errorAndCrash("Inconsitant state")
    21.9                  return
   21.10              }
   21.11  
   21.12              guard isDraftsOrOutbox || composeMode == .forward else {
   21.13 -                Logger.frontendLogger.errorAndCrash("Unsupported mode or message")
   21.14 +                Log.shared.errorAndCrash("Unsupported mode or message")
   21.15                  return
   21.16              }
   21.17              if let html = msg.longMessageFormatted {
   21.18 @@ -220,7 +220,7 @@
   21.19          // Assure the image is set.
   21.20          if attachment.image == nil {
   21.21              guard let safeData = attachment.data else {
   21.22 -                Logger.frontendLogger.errorAndCrash("No data")
   21.23 +                Log.shared.errorAndCrash("No data")
   21.24                  return
   21.25              }
   21.26              attachment.image = UIImage(data: safeData)
    22.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel.swift	Wed May 08 12:23:41 2019 +0200
    22.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel.swift	Fri May 10 10:50:12 2019 +0200
    22.3 @@ -77,7 +77,7 @@
    22.4          guard
    22.5              let vm = bodySection?.rows.first,
    22.6              let body = indexPath(for: vm) else {
    22.7 -                Logger.frontendLogger.errorAndCrash("No body")
    22.8 +                Log.shared.errorAndCrash("No body")
    22.9                  return IndexPath(row: 0, section: 0)
   22.10          }
   22.11          return body
   22.12 @@ -129,12 +129,12 @@
   22.13  
   22.14      public func handleUserClickedSendButton() {
   22.15          guard let msg = ComposeUtil.messageToSend(withDataFrom: state) else {
   22.16 -            Logger.frontendLogger.warn("No message for sending")
   22.17 +            Log.shared.warn("No message for sending")
   22.18              return
   22.19          }
   22.20          msg.save()
   22.21          guard let data = state.initData else {
   22.22 -            Logger.frontendLogger.errorAndCrash("No data")
   22.23 +            Log.shared.errorAndCrash("No data")
   22.24              return
   22.25          }
   22.26          if data.isDraftsOrOutbox {
   22.27 @@ -152,7 +152,7 @@
   22.28  
   22.29      public func handleRemovedRow(at indexPath: IndexPath) {
   22.30          guard let removeeVM = viewModel(for: indexPath) as? AttachmentViewModel else {
   22.31 -                Logger.frontendLogger.errorAndCrash("Only attachmnets can be removed by the user")
   22.32 +                Log.shared.errorAndCrash("Only attachmnets can be removed by the user")
   22.33                  return
   22.34          }
   22.35          removeNonInlinedAttachment(removeeVM.attachment)
   22.36 @@ -160,7 +160,7 @@
   22.37  
   22.38      private func deleteOriginalMessage() {
   22.39          guard let data = state.initData else {
   22.40 -            Logger.frontendLogger.errorAndCrash("No data")
   22.41 +            Log.shared.errorAndCrash("No data")
   22.42              return
   22.43          }
   22.44          guard let om = data.originalMessage else {
   22.45 @@ -183,7 +183,7 @@
   22.46          for section in sections where section.type == .recipients {
   22.47              for row  in section.rows where row is RecipientCellViewModel {
   22.48                  guard let recipientVM = row as? RecipientCellViewModel else {
   22.49 -                    Logger.frontendLogger.errorAndCrash("Cast error")
   22.50 +                    Log.shared.errorAndCrash("Cast error")
   22.51                      return false
   22.52                  }
   22.53                  if recipientVM.isDirty {
   22.54 @@ -362,14 +362,14 @@
   22.55  extension ComposeViewModel {
   22.56      private func removeNonInlinedAttachment(_ removee: Attachment) {
   22.57          guard let section = section(for: .attachments) else {
   22.58 -            Logger.frontendLogger.errorAndCrash("Only attachmnets can be removed by the user")
   22.59 +            Log.shared.errorAndCrash("Only attachmnets can be removed by the user")
   22.60              return
   22.61          }
   22.62          // Remove from section
   22.63          var newAttachmentVMs = [AttachmentViewModel]()
   22.64          for vm in section.rows {
   22.65              guard let aVM = vm as? AttachmentViewModel else {
   22.66 -                Logger.frontendLogger.errorAndCrash("Error casting")
   22.67 +                Log.shared.errorAndCrash("Error casting")
   22.68                  return
   22.69              }
   22.70              if aVM.attachment != removee {
   22.71 @@ -395,7 +395,7 @@
   22.72              existing.rows.append(AttachmentViewModel(attachment: att))
   22.73          } else {
   22.74              guard let new = Section(type: .attachments, for: state, cellVmDelegate: self) else {
   22.75 -                Logger.frontendLogger.errorAndCrash("Invalid state")
   22.76 +                Log.shared.errorAndCrash("Invalid state")
   22.77                  return
   22.78              }
   22.79              sections.append(new)
   22.80 @@ -422,7 +422,7 @@
   22.81              let idxPath = lastRowWithSuggestions,
   22.82              let recipientVM = sections[idxPath.section].rows[idxPath.row] as? RecipientCellViewModel
   22.83              else {
   22.84 -                Logger.frontendLogger.errorAndCrash("No row VM")
   22.85 +                Log.shared.errorAndCrash("No row VM")
   22.86              return
   22.87          }
   22.88          recipientVM.add(recipient: identity)
   22.89 @@ -473,7 +473,7 @@
   22.90          didSelect mediaAttachment: MediaAttachmentPickerProviderViewModel.MediaAttachment) {
   22.91          if mediaAttachment.type == .image {
   22.92              guard let bodyViewModel = bodyVM else {
   22.93 -                Logger.frontendLogger.errorAndCrash("No bodyVM. Maybe valid as picking is async.")
   22.94 +                Log.shared.errorAndCrash("No bodyVM. Maybe valid as picking is async.")
   22.95                  return
   22.96              }
   22.97              bodyViewModel.inline(attachment: mediaAttachment.attachment)
   22.98 @@ -498,7 +498,7 @@
   22.99  
  22.100      public var deleteActionTitle: String {
  22.101          guard let data = state.initData else {
  22.102 -            Logger.frontendLogger.errorAndCrash("No data")
  22.103 +            Log.shared.errorAndCrash("No data")
  22.104              return ""
  22.105          }
  22.106          let title: String
  22.107 @@ -517,7 +517,7 @@
  22.108  
  22.109      public var saveActionTitle: String {
  22.110          guard let data = state.initData else {
  22.111 -            Logger.frontendLogger.errorAndCrash("No data")
  22.112 +            Log.shared.errorAndCrash("No data")
  22.113              return ""
  22.114          }
  22.115          let title: String
  22.116 @@ -541,7 +541,7 @@
  22.117  
  22.118      public func handleDeleteActionTriggered() {
  22.119          guard let data = state.initData else {
  22.120 -            Logger.frontendLogger.errorAndCrash("No data")
  22.121 +            Log.shared.errorAndCrash("No data")
  22.122              return
  22.123          }
  22.124          if data.isOutbox {
  22.125 @@ -552,7 +552,7 @@
  22.126  
  22.127      public func handleSaveActionTriggered() {
  22.128          guard let data = state.initData else {
  22.129 -            Logger.frontendLogger.errorAndCrash("No data")
  22.130 +            Log.shared.errorAndCrash("No data")
  22.131              return
  22.132          }
  22.133          if data.isDraftsOrOutbox {
  22.134 @@ -568,12 +568,12 @@
  22.135          }
  22.136  
  22.137          guard let msg = ComposeUtil.messageToSend(withDataFrom: state) else {
  22.138 -            Logger.frontendLogger.errorAndCrash("No message")
  22.139 +            Log.shared.errorAndCrash("No message")
  22.140              return
  22.141          }
  22.142          let acc = msg.parent.account
  22.143          guard let f = Folder.by(account:acc, folderType: .drafts) else {
  22.144 -            Logger.frontendLogger.errorAndCrash("No drafts")
  22.145 +            Log.shared.errorAndCrash("No drafts")
  22.146              return
  22.147          }
  22.148          msg.parent = f
  22.149 @@ -617,7 +617,7 @@
  22.150  
  22.151      func recipientCellViewModel(_ vm: RecipientCellViewModel, didBeginEditing text: String) {
  22.152          guard let idxPath = indexPath(for: vm) else {
  22.153 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  22.154 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  22.155              return
  22.156          }
  22.157          lastRowWithSuggestions = idxPath
  22.158 @@ -633,7 +633,7 @@
  22.159  
  22.160      func recipientCellViewModel(_ vm: RecipientCellViewModel, textChanged newText: String) {
  22.161          guard let idxPath = indexPath(for: vm) else {
  22.162 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  22.163 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  22.164              return
  22.165          }
  22.166          lastRowWithSuggestions = idxPath
  22.167 @@ -650,7 +650,7 @@
  22.168  extension ComposeViewModel: AccountCellViewModelResultDelegate {
  22.169      func accountCellViewModel(_ vm: AccountCellViewModel, accountChangedTo account: Account) {
  22.170          guard let idxPath = indexPath(for: vm) else {
  22.171 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  22.172 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  22.173              return
  22.174          }
  22.175          state.from = account.user
  22.176 @@ -664,7 +664,7 @@
  22.177  
  22.178      func subjectCellViewModelDidChangeSubject(_ vm: SubjectCellViewModel) {
  22.179          guard let idxPath = indexPath(for: vm) else {
  22.180 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  22.181 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  22.182              return
  22.183          }
  22.184          state.subject = vm.content ?? ""
  22.185 @@ -703,7 +703,7 @@
  22.186          state.bodyHtml = html
  22.187          state.bodyPlaintext = plain
  22.188          guard let idxPath = indexPath(for: vm) else {
  22.189 -            Logger.frontendLogger.errorAndCrash("We got called by a non-existing VM?")
  22.190 +            Log.shared.errorAndCrash("We got called by a non-existing VM?")
  22.191              return
  22.192          }
  22.193          delegate?.contentChanged(inRowAt: idxPath)
    23.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModelState.swift	Wed May 08 12:23:41 2019 +0200
    23.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModelState.swift	Fri May 10 10:50:12 2019 +0200
    23.3 @@ -124,7 +124,7 @@
    23.4  
    23.5          private func setup() {
    23.6              guard let initData = initData else {
    23.7 -                Logger.frontendLogger.errorAndCrash("No data")
    23.8 +                Log.shared.errorAndCrash("No data")
    23.9                  return
   23.10              }
   23.11              toRecipients = initData.toRecipients
    24.1 --- a/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Wed May 08 12:23:41 2019 +0200
    24.2 +++ b/pEpForiOS/UI/EmailDisplay/Background/AttachmentToLocalURLOperation.swift	Fri May 10 10:50:12 2019 +0200
    24.3 @@ -21,7 +21,7 @@
    24.4  
    24.5      override func main() {
    24.6          guard let data = attachment.data else {
    24.7 -            Logger.backendLogger.warn("Attachment without data")
    24.8 +            Log.shared.warn("Attachment without data")
    24.9              return
   24.10          }
   24.11          var tmpDirURL: URL?
   24.12 @@ -44,7 +44,7 @@
   24.13              try data.write(to: theURL)
   24.14              fileURL = theURL
   24.15          } catch {
   24.16 -            Logger.backendLogger.log(error: error)
   24.17 +            Log.shared.log(error: error)
   24.18          }
   24.19      }
   24.20  }
    25.1 --- a/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Wed May 08 12:23:41 2019 +0200
    25.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailViewController.swift	Fri May 10 10:50:12 2019 +0200
    25.3 @@ -186,7 +186,7 @@
    25.4      // Sets the destructive bottom bar item accordint to the message (trash/archive)
    25.5      private func setupDestructiveButtonIcon() {
    25.6          guard let msg = message else {
    25.7 -            Logger.frontendLogger.errorAndCrash("No message")
    25.8 +            Log.shared.errorAndCrash("No message")
    25.9              return
   25.10          }
   25.11  
   25.12 @@ -236,7 +236,7 @@
   25.13              storyboard.instantiateViewController(withIdentifier: SecureWebViewController.storyboardId)
   25.14                  as? SecureWebViewController
   25.15              else {
   25.16 -                Logger.frontendLogger.errorAndCrash("Cast error")
   25.17 +                Log.shared.errorAndCrash("Cast error")
   25.18                  return SecureWebViewController()
   25.19          }
   25.20          vc.zoomingEnabled = true
   25.21 @@ -267,7 +267,7 @@
   25.22  
   25.23      private func setup(contentCell: MessageContentCell, rowData: ComposeFieldModel) {
   25.24          guard let m = message else {
   25.25 -            Logger.frontendLogger.errorAndCrash("No msg.")
   25.26 +            Log.shared.errorAndCrash("No msg.")
   25.27              return
   25.28          }
   25.29          if let htmlBody = htmlBody(message: m) {
   25.30 @@ -329,7 +329,7 @@
   25.31              message = m
   25.32          }
   25.33  
   25.34 -        Logger.frontendLogger.log("next, will reload table view")
   25.35 +        Log.shared.log("next, will reload table view")
   25.36          configureTableRows()
   25.37          tableView.reloadData()
   25.38          configureView()
   25.39 @@ -341,7 +341,7 @@
   25.40              message = m
   25.41          }
   25.42  
   25.43 -        Logger.frontendLogger.log("previous, will reload table view")
   25.44 +        Log.shared.log("previous, will reload table view")
   25.45          configureTableRows()
   25.46          tableView.reloadData()
   25.47          configureView()
   25.48 @@ -353,19 +353,19 @@
   25.49          let alert = ReplyAlertCreator(replyAllChecker: ReplyAllPossibleChecker())
   25.50              .withReplyOption { [weak self] action 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                  me.performSegue(withIdentifier: .segueReplyFrom , sender: self)
   25.57              }.withReplyAllOption(forMessage: message) { [weak self] action in
   25.58                  guard let me = self else {
   25.59 -                    Logger.frontendLogger.lostMySelf()
   25.60 +                    Log.shared.errorAndCrash("Lost MySelf")
   25.61                      return
   25.62                  }
   25.63                  me.performSegue(withIdentifier: .segueReplyAllForm , sender: self)
   25.64              }.withFordwardOption { [weak self] action in
   25.65                  guard let me = self else {
   25.66 -                    Logger.frontendLogger.lostMySelf()
   25.67 +                    Log.shared.errorAndCrash("Lost MySelf")
   25.68                      return
   25.69                  }
   25.70                  me.performSegue(withIdentifier: .segueForward , sender: self)
   25.71 @@ -463,7 +463,7 @@
   25.72  
   25.73      override func tableView(
   25.74          _ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   25.75 -        Logger.frontendLogger.log("cell for %d:%d", indexPath.section, indexPath.row)
   25.76 +        Log.shared.log("cell for %d:%d", indexPath.section, indexPath.row)
   25.77          guard
   25.78              let row = tableData?.getRow(at: indexPath.row),
   25.79              let cell = tableView.dequeueReusableCell(
   25.80 @@ -485,7 +485,7 @@
   25.81          _ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
   25.82          guard
   25.83              let row = tableData?.getRow(at: indexPath.row) else {
   25.84 -                Logger.frontendLogger.errorAndCrash("Missing data")
   25.85 +                Log.shared.errorAndCrash("Missing data")
   25.86                  return tableView.estimatedRowHeight
   25.87          }
   25.88  
   25.89 @@ -525,7 +525,7 @@
   25.90          case .segueReplyFrom, .segueReplyAllForm, .segueForward:
   25.91              guard  let nav = segue.destination as? UINavigationController,
   25.92                  let destination = nav.topViewController as? ComposeTableViewController else {
   25.93 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   25.94 +                    Log.shared.errorAndCrash("No DVC?")
   25.95                      break
   25.96              }
   25.97              destination.appConfig = appConfig
   25.98 @@ -536,7 +536,7 @@
   25.99          case .segueShowMoveToFolder:
  25.100              guard  let nav = segue.destination as? UINavigationController,
  25.101                  let destination = nav.topViewController as? MoveToAccountViewController else {
  25.102 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
  25.103 +                    Log.shared.errorAndCrash("No DVC?")
  25.104                      break
  25.105              }
  25.106              destination.appConfig = appConfig
  25.107 @@ -549,7 +549,7 @@
  25.108              guard let nv = segue.destination as? UINavigationController,
  25.109                  let vc = nv.topViewController as? HandshakeViewController,
  25.110                  let titleView = navigationItem.titleView else {
  25.111 -                Logger.frontendLogger.errorAndCrash("No DVC?")
  25.112 +                Log.shared.errorAndCrash("No DVC?")
  25.113                  break
  25.114              }
  25.115  
  25.116 @@ -576,7 +576,7 @@
  25.117          } else if segueId == .segueForward {
  25.118              return  .forward
  25.119          } else {
  25.120 -            Logger.frontendLogger.errorAndCrash("Unsupported input")
  25.121 +            Log.shared.errorAndCrash("Unsupported input")
  25.122              return .replyFrom
  25.123          }
  25.124      }
    26.1 --- a/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Wed May 08 12:23:41 2019 +0200
    26.2 +++ b/pEpForiOS/UI/EmailDisplay/Stuff that is named Compose but is used only in EmailView/ComposeDataSource.swift	Fri May 10 10:50:12 2019 +0200
    26.3 @@ -40,12 +40,12 @@
    26.4          } else {
    26.5              filterRows(filter: { $0.type != .mailingList} )
    26.6          }
    26.7 -        Logger.frontendLogger.log("filtering rows")
    26.8 +        Log.shared.log("filtering rows")
    26.9      }
   26.10  
   26.11      func numberOfRows() -> Int {
   26.12          let visibleRows = getVisibleRows()
   26.13 -        Logger.frontendLogger.log("number of rows -> %d", visibleRows.count)
   26.14 +        Log.shared.log("number of rows -> %d", visibleRows.count)
   26.15          return visibleRows.count
   26.16      }
   26.17  
   26.18 @@ -74,7 +74,7 @@
   26.19  
   26.20          subscript(index: Int) -> Row? {
   26.21              if index < 0 || index > (attachments.count - 1) {
   26.22 -                Logger.frontendLogger.errorAndCrash("Index out of bounds")
   26.23 +                Log.shared.errorAndCrash("Index out of bounds")
   26.24                  return nil
   26.25              }
   26.26              let attachment = attachments[index]
   26.27 @@ -115,7 +115,7 @@
   26.28  
   26.29          mutating func remove(at index: Int) {
   26.30              if index < 0 || index > (attachments.count - 1) {
   26.31 -                Logger.frontendLogger.errorAndCrash("Index out of bounds")
   26.32 +                Log.shared.errorAndCrash("Index out of bounds")
   26.33                  return
   26.34              }
   26.35              attachments.remove(at: index)
    27.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Wed May 08 12:23:41 2019 +0200
    27.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewController.swift	Fri May 10 10:50:12 2019 +0200
    27.3 @@ -202,7 +202,7 @@
    27.4          }
    27.5          if splitViewController.isCollapsed {
    27.6              guard let vm = model else {
    27.7 -                Logger.frontendLogger.errorAndCrash("Invalid state")
    27.8 +                Log.shared.errorAndCrash("Invalid state")
    27.9                  return
   27.10              }
   27.11              let unreadFilterActive = vm.unreadFilterEnabled()
   27.12 @@ -422,7 +422,7 @@
   27.13      
   27.14      @IBAction func filterButtonHasBeenPressed(_ sender: UIBarButtonItem) {
   27.15          guard let vm = model else {
   27.16 -            Logger.frontendLogger.errorAndCrash("We should have a model here")
   27.17 +            Log.shared.errorAndCrash("We should have a model here")
   27.18              return
   27.19          }
   27.20          vm.isFilterEnabled = !vm.isFilterEnabled
   27.21 @@ -443,7 +443,7 @@
   27.22  
   27.23      private func updateFilterButtonView() {
   27.24          guard let vm = model else {
   27.25 -            Logger.frontendLogger.errorAndCrash("We should have a model here")
   27.26 +            Log.shared.errorAndCrash("We should have a model here")
   27.27              return
   27.28          }
   27.29  
   27.30 @@ -489,7 +489,7 @@
   27.31              }
   27.32              theCell.configure(for:viewModel)
   27.33          } else {
   27.34 -            Logger.frontendLogger.errorAndCrash("dequeued wrong cell")
   27.35 +            Log.shared.errorAndCrash("dequeued wrong cell")
   27.36          }
   27.37  
   27.38          return cell
   27.39 @@ -509,7 +509,7 @@
   27.40          var swipeActions = [SwipeAction]()
   27.41  
   27.42          guard let model = model else {
   27.43 -            Logger.frontendLogger.errorAndCrash("Should have VM")
   27.44 +            Log.shared.errorAndCrash("Should have VM")
   27.45              return nil
   27.46          }
   27.47  
   27.48 @@ -520,7 +520,7 @@
   27.49                          title: destructiveAction.title(forDisplayMode: .titleAndImage)) {
   27.50                  [weak self] action, indexPath in
   27.51                  guard let me = self else {
   27.52 -                    Logger.frontendLogger.lostMySelf()
   27.53 +                    Log.shared.errorAndCrash("Lost MySelf")
   27.54                      return
   27.55                  }
   27.56  
   27.57 @@ -536,7 +536,7 @@
   27.58              let flagAction = SwipeAction(style: .default, title: "Flag") {
   27.59                  [weak self] action, indexPath in
   27.60                  guard let me = self else {
   27.61 -                    Logger.frontendLogger.lostMySelf()
   27.62 +                    Log.shared.errorAndCrash("Lost MySelf")
   27.63                      return
   27.64                  }
   27.65                  me.flagAction(forCellAt: indexPath)
   27.66 @@ -556,7 +556,7 @@
   27.67              let moreAction = SwipeAction(style: .default, title: "More") {
   27.68                  [weak self] action, indexPath in
   27.69                  guard let me = self else {
   27.70 -                    Logger.frontendLogger.lostMySelf()
   27.71 +                    Log.shared.errorAndCrash("Lost MySelf")
   27.72                      return
   27.73                  }
   27.74                  me.moreAction(forCellAt: indexPath)
   27.75 @@ -592,7 +592,7 @@
   27.76              }
   27.77          } else {
   27.78              guard let model = model else {
   27.79 -                Logger.frontendLogger.errorAndCrash("No folder")
   27.80 +                Log.shared.errorAndCrash("No folder")
   27.81                  return
   27.82              }
   27.83              lastSelectedIndexPath = indexPath
   27.84 @@ -620,7 +620,7 @@
   27.85      override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell,
   27.86                              forRowAt indexPath: IndexPath) {
   27.87          guard let vm = model else {
   27.88 -            Logger.frontendLogger.errorAndCrash("No model.")
   27.89 +            Log.shared.errorAndCrash("No model.")
   27.90              return
   27.91          }
   27.92          vm.fetchOlderMessagesIfRequired(forIndexPath: indexPath)
   27.93 @@ -663,7 +663,7 @@
   27.94  
   27.95      func didDismissSearchController(_ searchController: UISearchController) {
   27.96          guard let vm = model else {
   27.97 -            Logger.frontendLogger.errorAndCrash("No chance to remove filter, sorry.")
   27.98 +            Log.shared.errorAndCrash("No chance to remove filter, sorry.")
   27.99              return
  27.100          }
  27.101          vm.removeSearchFilter()
  27.102 @@ -687,7 +687,7 @@
  27.103                  storyboard.instantiateViewController(withIdentifier: "threadViewController")
  27.104                      as? ThreadViewController
  27.105                  else {
  27.106 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  27.107 +                    Log.shared.errorAndCrash("Segue issue")
  27.108                      return
  27.109              }
  27.110  
  27.111 @@ -783,7 +783,7 @@
  27.112      func emailListViewModel(viewModel: EmailListViewModel,
  27.113                              didChangeSeenStateForDataAt indexPaths: [IndexPath]) {
  27.114          guard let isIphone = splitViewController?.isCollapsed, let vm = model else {
  27.115 -            Logger.frontendLogger.errorAndCrash("Invalid state")
  27.116 +            Log.shared.errorAndCrash("Invalid state")
  27.117              return
  27.118          }
  27.119  
  27.120 @@ -861,7 +861,7 @@
  27.121          let title = NSLocalizedString("Move to Folder", comment: "EmailList action title")
  27.122          return UIAlertAction(title: title, style: .default) { [weak self] action in
  27.123              guard let me = self else {
  27.124 -                Logger.frontendLogger.lostMySelf()
  27.125 +                Log.shared.errorAndCrash("Lost MySelf")
  27.126                  return
  27.127              }
  27.128              me.performSegue(withIdentifier: .segueShowMoveToFolder, sender: me)
  27.129 @@ -873,7 +873,7 @@
  27.130          return  UIAlertAction(title: title, style: .cancel) {
  27.131              [weak self] action in
  27.132              guard let me = self else {
  27.133 -                Logger.frontendLogger.lostMySelf()
  27.134 +                Log.shared.errorAndCrash("Lost MySelf")
  27.135                  return
  27.136              }
  27.137              me.tableView.beginUpdates()
  27.138 @@ -887,7 +887,7 @@
  27.139          return UIAlertAction(title: title, style: .default) {
  27.140              [weak self] action in
  27.141              guard let me = self else {
  27.142 -                Logger.frontendLogger.lostMySelf()
  27.143 +                Log.shared.errorAndCrash("Lost MySelf")
  27.144                  return
  27.145              }
  27.146              me.performSegue(withIdentifier: .segueReply, sender: me)
  27.147 @@ -900,7 +900,7 @@
  27.148              return UIAlertAction(title: title, style: .default) {
  27.149                  [weak self] action in
  27.150                  guard let me = self else {
  27.151 -                    Logger.frontendLogger.lostMySelf()
  27.152 +                    Log.shared.errorAndCrash("Lost MySelf")
  27.153                      return
  27.154                  }
  27.155                  me.performSegue(withIdentifier: .segueReplyAll, sender: me)
  27.156 @@ -915,7 +915,7 @@
  27.157          return UIAlertAction(title: title, style: .default) {
  27.158              [weak self] action in
  27.159              guard let me = self else {
  27.160 -                Logger.frontendLogger.lostMySelf()
  27.161 +                Log.shared.errorAndCrash("Lost MySelf")
  27.162                  return
  27.163              }
  27.164              me.performSegue(withIdentifier: .segueForward, sender: me)
  27.165 @@ -939,11 +939,11 @@
  27.166  
  27.167      func flagAction(forCellAt indexPath: IndexPath) {
  27.168          guard let row = model?.viewModel(for: indexPath.row) else {
  27.169 -            Logger.frontendLogger.errorAndCrash("No data for indexPath!")
  27.170 +            Log.shared.errorAndCrash("No data for indexPath!")
  27.171              return
  27.172          }
  27.173          guard let cell = self.tableView.cellForRow(at: indexPath) as? EmailListViewCell else {
  27.174 -            Logger.frontendLogger.errorAndCrash("No cell for indexPath!")
  27.175 +            Log.shared.errorAndCrash("No cell for indexPath!")
  27.176              return
  27.177          }
  27.178          if row.isFlagged {
  27.179 @@ -1013,7 +1013,7 @@
  27.180                  let vc = nav.rootViewController as? EmailViewController,
  27.181                  let indexPath = lastSelectedIndexPath,
  27.182                  let message = model?.message(representedByRowAt: indexPath) else {
  27.183 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  27.184 +                    Log.shared.errorAndCrash("Segue issue")
  27.185                      return
  27.186              }
  27.187              vc.appConfig = appConfig
  27.188 @@ -1030,7 +1030,7 @@
  27.189                      return
  27.190              }
  27.191              guard let message = model?.message(representedByRowAt: indexPath) else {
  27.192 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  27.193 +                Log.shared.errorAndCrash("Segue issue")
  27.194                  return
  27.195              }
  27.196              vc.appConfig = appConfig
  27.197 @@ -1041,7 +1041,7 @@
  27.198              model?.updateThreadListDelegate = viewModel*/
  27.199          case .segueShowFilter:
  27.200              guard let destiny = segue.destination as? FilterTableViewController  else {
  27.201 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  27.202 +                Log.shared.errorAndCrash("Segue issue")
  27.203                  return
  27.204              }
  27.205              destiny.appConfig = appConfig
  27.206 @@ -1053,7 +1053,7 @@
  27.207              guard
  27.208                  let nav = segue.destination as? UINavigationController,
  27.209                  let vc = nav.rootViewController as? LoginViewController else {
  27.210 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
  27.211 +                    Log.shared.errorAndCrash("Segue issue")
  27.212                      return
  27.213              }
  27.214              vc.appConfig = appConfig
  27.215 @@ -1062,7 +1062,7 @@
  27.216              break
  27.217          case .segueFolderViews:
  27.218              guard let vC = segue.destination as? FolderTableViewController  else {
  27.219 -                Logger.frontendLogger.errorAndCrash("Segue issue")
  27.220 +                Log.shared.errorAndCrash("Segue issue")
  27.221                  return
  27.222              }
  27.223              vC.appConfig = appConfig
  27.224 @@ -1080,7 +1080,7 @@
  27.225              guard  let nav = segue.destination as? UINavigationController,
  27.226                  let destination = nav.topViewController as? MoveToAccountViewController
  27.227                  else {
  27.228 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
  27.229 +                    Log.shared.errorAndCrash("No DVC?")
  27.230                      break
  27.231              }
  27.232  
  27.233 @@ -1093,7 +1093,7 @@
  27.234              //No initialization needed
  27.235              break
  27.236          default:
  27.237 -            Logger.frontendLogger.errorAndCrash("Unhandled segue")
  27.238 +            Log.shared.errorAndCrash("Unhandled segue")
  27.239              break
  27.240          }
  27.241      }
  27.242 @@ -1109,7 +1109,7 @@
  27.243              let composeVc = nav.topViewController as? ComposeTableViewController,
  27.244              let composeMode = composeMode(for: segueId),
  27.245              let vm = model else {
  27.246 -                Logger.frontendLogger.errorAndCrash("composeViewController setup issue")
  27.247 +                Log.shared.errorAndCrash("composeViewController setup issue")
  27.248                  return
  27.249          }
  27.250          composeVc.appConfig = appConfig
  27.251 @@ -1118,7 +1118,7 @@
  27.252              // This is not a simple compose (but reply, forward or such),
  27.253              // thus we have to pass the original message.
  27.254              guard let indexPath = lastSelectedIndexPath else {
  27.255 -                    Logger.frontendLogger.errorAndCrash("Invalid state")
  27.256 +                    Log.shared.errorAndCrash("Invalid state")
  27.257                      return
  27.258              }
  27.259  
    28.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift	Wed May 08 12:23:41 2019 +0200
    28.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+EmailDisplayDelegate.swift	Fri May 10 10:50:12 2019 +0200
    28.3 @@ -23,7 +23,7 @@
    28.4  
    28.5          MessageModelUtil.performAndWait { [weak self] in
    28.6              guard let me = self else {
    28.7 -                Logger.frontendLogger.lostMySelf()
    28.8 +                Log.shared.errorAndCrash("Lost MySelf")
    28.9                  return
   28.10              }
   28.11              me.didDelete(message: message)
    29.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift	Wed May 08 12:23:41 2019 +0200
    29.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel+MessageFolderDelegate.swift	Fri May 10 10:50:12 2019 +0200
    29.3 @@ -17,7 +17,7 @@
    29.4      func didCreate(message: Message) {
    29.5          DispatchQueue.main.async { [weak self] in
    29.6              guard let me = self else {
    29.7 -                Logger.frontendLogger.lostMySelf()
    29.8 +                Log.shared.errorAndCrash("Lost MySelf")
    29.9                  return
   29.10              }
   29.11              me.didCreateInternal(message: message)
   29.12 @@ -27,7 +27,7 @@
   29.13      func didUpdate(message: Message) {
   29.14          DispatchQueue.main.async { [weak self] in
   29.15              guard let me = self else {
   29.16 -                Logger.frontendLogger.lostMySelf()
   29.17 +                Log.shared.errorAndCrash("Lost MySelf")
   29.18                  return
   29.19              }
   29.20              me.didUpdateInternal(message: message)
   29.21 @@ -37,7 +37,7 @@
   29.22      func didDelete(message: Message) {
   29.23          DispatchQueue.main.async { [weak self] in
   29.24              guard let me = self else {
   29.25 -                Logger.frontendLogger.lostMySelf()
   29.26 +                Log.shared.errorAndCrash("Lost MySelf")
   29.27                  return
   29.28              }
   29.29              me.didDeleteInternal(message: message)
   29.30 @@ -140,7 +140,7 @@
   29.31  
   29.32          // We do have this message in our (top message) model, so we do have to update it
   29.33          guard let existingMessage = messages.object(at: indexExisting) else {
   29.34 -            Logger.frontendLogger.errorAndCrash(
   29.35 +            Log.shared.errorAndCrash(
   29.36                  "We should have the message at this point")
   29.37              return
   29.38          }
   29.39 @@ -193,7 +193,7 @@
   29.40          // The updated message has to be shown. Add it to the model ...
   29.41          let indexInserted = me.messages.insert(object: previewMessage)
   29.42          if indexExisting != indexInserted {
   29.43 -            Logger.frontendLogger.warn(
   29.44 +            Log.shared.warn(
   29.45                  "When updating a message, the the new index of the message must be the same as the old index. Something is fishy here."
   29.46              )
   29.47          }
    30.1 --- a/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Wed May 08 12:23:41 2019 +0200
    30.2 +++ b/pEpForiOS/UI/EmailDisplayList/EmailListViewModel.swift	Fri May 10 10:50:12 2019 +0200
    30.3 @@ -165,7 +165,7 @@
    30.4  
    30.5      func viewModel(for index: Int) -> MessageViewModel? {
    30.6          guard let messageViewModel = messages.object(at: index) else {
    30.7 -            Logger.frontendLogger.errorAndCrash("InconsistencyviewModel vs. model")
    30.8 +            Log.shared.errorAndCrash("InconsistencyviewModel vs. model")
    30.9              return nil
   30.10          }
   30.11          return messageViewModel
   30.12 @@ -283,7 +283,7 @@
   30.13  
   30.14          for pvm in deletees {
   30.15              guard let message = pvm.message() else {
   30.16 -                Logger.frontendLogger.errorAndCrash("No mesage")
   30.17 +                Log.shared.errorAndCrash("No mesage")
   30.18                  return
   30.19              }
   30.20              delete(message: message)
   30.21 @@ -334,7 +334,7 @@
   30.22  
   30.23      func delete(forIndexPath indexPath: IndexPath) {
   30.24          guard let deletedMessage = deleteMessage(at: indexPath) else {
   30.25 -            Logger.frontendLogger.errorAndCrash(
   30.26 +            Log.shared.errorAndCrash(
   30.27                  "Not sure if this is a valid case. Remove this log if so.")
   30.28              return
   30.29          }
   30.30 @@ -442,7 +442,7 @@
   30.31          if folderToShow is UnifiedInbox {
   30.32              // folderToShow is unified inbox, fetch parent folder from DB.
   30.33              guard let folder = messages.object(at: index)?.message()?.parent else {
   30.34 -                    Logger.frontendLogger.errorAndCrash("Dangling Message")
   30.35 +                    Log.shared.errorAndCrash("Dangling Message")
   30.36                      return folderToShow
   30.37              }
   30.38              parentFolder = folder
   30.39 @@ -555,7 +555,7 @@
   30.40  
   30.41      public func removeSearchFilter() {
   30.42          guard let filter = folderToShow.filter else {
   30.43 -            Logger.frontendLogger.errorAndCrash("No folder.")
   30.44 +            Log.shared.errorAndCrash("No folder.")
   30.45              return
   30.46          }
   30.47          let filtersChanged = filter.removeSearchFilter()
   30.48 @@ -570,7 +570,7 @@
   30.49          }
   30.50  
   30.51          guard let folderFilter = folderToShow.filter else {
   30.52 -            Logger.frontendLogger.errorAndCrash("We just set the filter but do not have one?")
   30.53 +            Log.shared.errorAndCrash("We just set the filter but do not have one?")
   30.54              return CompositeFilter<FilterBase>.defaultFilter()
   30.55          }
   30.56          return folderFilter
   30.57 @@ -580,7 +580,7 @@
   30.58  
   30.59      func folderIsDraft(_ parentFolder: Folder?) -> Bool {
   30.60          guard let folder = parentFolder else {
   30.61 -            Logger.frontendLogger.errorAndCrash("No parent.")
   30.62 +            Log.shared.errorAndCrash("No parent.")
   30.63              return false
   30.64          }
   30.65          return folder.folderType == .drafts
   30.66 @@ -588,7 +588,7 @@
   30.67  
   30.68      func folderIsOutbox(_ parentFolder: Folder?) -> Bool {
   30.69          guard let folder = parentFolder else {
   30.70 -            Logger.frontendLogger.errorAndCrash("No parent.")
   30.71 +            Log.shared.errorAndCrash("No parent.")
   30.72              return false
   30.73          }
   30.74          return folder.folderType == .outbox
    31.1 --- a/pEpForiOS/UI/Filter/ViewModel/FilterViewModel.swift	Wed May 08 12:23:41 2019 +0200
    31.2 +++ b/pEpForiOS/UI/Filter/ViewModel/FilterViewModel.swift	Fri May 10 10:50:12 2019 +0200
    31.3 @@ -46,7 +46,7 @@
    31.4          case .accouts:
    31.5              for account in Account.all() {
    31.6                  guard let icon = UIImage(named: "folders-icon-inbox") else {
    31.7 -                    Logger.frontendLogger.errorAndCrash("Error Loading images")
    31.8 +                    Log.shared.errorAndCrash("Error Loading images")
    31.9                      return
   31.10                  }
   31.11                  items.append(
   31.12 @@ -59,7 +59,7 @@
   31.13              break
   31.14          case .include:
   31.15              guard let unreadIcon = UIImage(named: "icon-unread") else {
   31.16 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   31.17 +                Log.shared.errorAndCrash("Error Loading images")
   31.18                  return
   31.19              }
   31.20              items.append(
   31.21 @@ -70,7 +70,7 @@
   31.22                                      filter: UnreadFilter()))
   31.23  
   31.24              guard let flaggedIcon = UIImage(named: "icon-flagged") else {
   31.25 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   31.26 +                Log.shared.errorAndCrash("Error Loading images")
   31.27                  return
   31.28              }
   31.29              items.append(
   31.30 @@ -82,7 +82,7 @@
   31.31              break
   31.32          case .other:
   31.33              guard let attachIcon = UIImage(named: "attachment-list-icon") else {
   31.34 -                Logger.frontendLogger.errorAndCrash("Error Loading images")
   31.35 +                Log.shared.errorAndCrash("Error Loading images")
   31.36                  return
   31.37              }
   31.38              items.append(
    32.1 --- a/pEpForiOS/UI/Folder/FolderTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    32.2 +++ b/pEpForiOS/UI/Folder/FolderTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    32.3 @@ -108,7 +108,7 @@
    32.4              header = CollapsibleTableViewHeader(reuseIdentifier: "header")
    32.5          }
    32.6          guard let vm = folderVM, let safeHeader = header else {
    32.7 -            Logger.frontendLogger.errorAndCrash("No header or no model.")
    32.8 +            Log.shared.errorAndCrash("No header or no model.")
    32.9              return header
   32.10          }
   32.11  
   32.12 @@ -127,7 +127,7 @@
   32.13      }
   32.14      override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
   32.15          guard let vm = folderVM else {
   32.16 -            Logger.frontendLogger.errorAndCrash("No model.")
   32.17 +            Log.shared.errorAndCrash("No model.")
   32.18              return 0.0
   32.19          }
   32.20          if vm[section].hidden {
   32.21 @@ -141,7 +141,7 @@
   32.22                              cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   32.23          let cell = tableView.dequeueReusableCell(withIdentifier: "Default", for: indexPath)
   32.24          guard let vm = folderVM else {
   32.25 -            Logger.frontendLogger.errorAndCrash("No model")
   32.26 +            Log.shared.errorAndCrash("No model")
   32.27              return cell
   32.28          }
   32.29          let fcvm = vm[indexPath.section][indexPath.item]
   32.30 @@ -160,7 +160,7 @@
   32.31      override func tableView(_ tableView: UITableView, indentationLevelForRowAt indexPath: IndexPath)
   32.32          -> Int {
   32.33              guard let vm = folderVM else {
   32.34 -                Logger.frontendLogger.errorAndCrash("No model")
   32.35 +                Log.shared.errorAndCrash("No model")
   32.36                  return 0
   32.37              }
   32.38          return vm[indexPath.section][indexPath.item].level - 1
   32.39 @@ -170,7 +170,7 @@
   32.40  
   32.41      override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
   32.42          guard let folderViewModel = folderVM else {
   32.43 -            Logger.frontendLogger.errorAndCrash("No model")
   32.44 +            Log.shared.errorAndCrash("No model")
   32.45              return
   32.46          }
   32.47          let cellViewModel = folderViewModel[indexPath.section][indexPath.row]
   32.48 @@ -189,7 +189,7 @@
   32.49              let vc = sb.instantiateViewController(
   32.50                  withIdentifier: EmailListViewController.storyboardId)
   32.51                  as? EmailListViewController else {
   32.52 -                    Logger.frontendLogger.errorAndCrash("Problem!")
   32.53 +                    Log.shared.errorAndCrash("Problem!")
   32.54                      return
   32.55          }
   32.56          vc.appConfig = appConfig
   32.57 @@ -214,7 +214,7 @@
   32.58              guard
   32.59                  let nav = segue.destination as? UINavigationController,
   32.60                  let vc = nav.rootViewController as? LoginViewController else {
   32.61 -                    Logger.frontendLogger.errorAndCrash("Missing VCs")
   32.62 +                    Log.shared.errorAndCrash("Missing VCs")
   32.63                      return
   32.64              }
   32.65              vc.appConfig = self.appConfig
   32.66 @@ -223,7 +223,7 @@
   32.67  
   32.68          } else if segue.identifier == "SettingsSegue" {
   32.69              guard let dvc = segue.destination as? SettingsTableViewController else {
   32.70 -                Logger.frontendLogger.errorAndCrash("Error casting DVC")
   32.71 +                Log.shared.errorAndCrash("Error casting DVC")
   32.72                  return
   32.73              }
   32.74              dvc.appConfig = self.appConfig
    33.1 --- a/pEpForiOS/UI/Folder/ViewModel/FolderSectionViewModel.swift	Wed May 08 12:23:41 2019 +0200
    33.2 +++ b/pEpForiOS/UI/Folder/ViewModel/FolderSectionViewModel.swift	Fri May 10 10:50:12 2019 +0200
    33.3 @@ -34,7 +34,7 @@
    33.4  
    33.5      private func generateAccountCells() {
    33.6          guard let ac = account else {
    33.7 -            Logger.frontendLogger.errorAndCrash("No account selected")
    33.8 +            Log.shared.errorAndCrash("No account selected")
    33.9              return
   33.10          }
   33.11          for folder in ac.rootFolders {
   33.12 @@ -52,7 +52,7 @@
   33.13  
   33.14      func getImage(callback: @escaping (UIImage?)-> Void) {
   33.15          guard let ac = account else {
   33.16 -            Logger.frontendLogger.errorAndCrash("No account selected")
   33.17 +            Log.shared.errorAndCrash("No account selected")
   33.18              return
   33.19          }
   33.20          if let cachedContactImage = contactImageTool.cachedIdentityImage(for: ac.user) {
    34.1 --- a/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Wed May 08 12:23:41 2019 +0200
    34.2 +++ b/pEpForiOS/UI/Handshake/HandshakeViewController.swift	Fri May 10 10:50:12 2019 +0200
    34.3 @@ -270,7 +270,7 @@
    34.4          do {
    34.5              languages = try theSession.languageList()
    34.6          } catch let err as NSError {
    34.7 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
    34.8 +            Log.shared.error("%{public}@", err.localizedDescription)
    34.9              languages = []
   34.10          }
   34.11  
   34.12 @@ -323,7 +323,7 @@
   34.13          do {
   34.14              destination.languages = try theSession.languageList()
   34.15          } catch let err as NSError {
   34.16 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
   34.17 +            Log.shared.error("%{public}@", err.localizedDescription)
   34.18              destination.languages = []
   34.19          }
   34.20      }
    35.1 --- a/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Wed May 08 12:23:41 2019 +0200
    35.2 +++ b/pEpForiOS/UI/Handshake/ViewModel/HandshakePartnerTableViewCellViewModel.swift	Fri May 10 10:50:12 2019 +0200
    35.3 @@ -108,7 +108,7 @@
    35.4          do {
    35.5              isPartnerpEpUser = try session.isPEPUser(pEpPartner).boolValue
    35.6          } catch let err as NSError {
    35.7 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
    35.8 +            Log.shared.error("%{public}@", err.localizedDescription)
    35.9              isPartnerpEpUser = false
   35.10          }
   35.11          setPartnerImage(for: partner)
   35.12 @@ -149,7 +149,7 @@
   35.13                  language: trustwordsLanguage,
   35.14                  full: trustwordsFull)
   35.15          } catch let err as NSError {
   35.16 -            Logger.frontendLogger.error("%{public}@", err.localizedDescription)
   35.17 +            Log.shared.error("%{public}@", err.localizedDescription)
   35.18              return nil
   35.19          }
   35.20      }
    36.1 --- a/pEpForiOS/UI/Login/LoginViewController.swift	Wed May 08 12:23:41 2019 +0200
    36.2 +++ b/pEpForiOS/UI/Login/LoginViewController.swift	Fri May 10 10:50:12 2019 +0200
    36.3 @@ -162,7 +162,7 @@
    36.4      }
    36.5  
    36.6      private func handleLoginError(error: Error, offerManualSetup: Bool) {
    36.7 -        Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    36.8 +        Log.shared.error("%{public}@", error.localizedDescription)
    36.9          self.isCurrentlyVerifying = false
   36.10          guard let error = DisplayUserError(withError: error) else {
   36.11              // Do nothing. The error type is not suitable to bother the user with.
   36.12 @@ -313,7 +313,7 @@
   36.13                     accountInput: VerifiableAccountProtocol?) {
   36.14          GCD.onMain() { [weak self] in
   36.15              guard let me = self else {
   36.16 -                Logger.frontendLogger.lostMySelf()
   36.17 +                Log.shared.errorAndCrash("Lost MySelf")
   36.18                  return
   36.19              }
   36.20              me.lastAccountInput = nil
    37.1 --- a/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Wed May 08 12:23:41 2019 +0200
    37.2 +++ b/pEpForiOS/UI/Login/ViewModel/LoginViewModel.swift	Fri May 10 10:50:12 2019 +0200
    37.3 @@ -101,7 +101,7 @@
    37.4  
    37.5          func statusOk() {
    37.6              if let error = AccountSettings.AccountSettingsError(accountSettings: acSettings) {
    37.7 -                Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    37.8 +                Log.shared.error("%{public}@", error.localizedDescription)
    37.9                  loginViewModelLoginErrorDelegate?.handle(loginError: error)
   37.10                  return
   37.11              }
   37.12 @@ -157,7 +157,7 @@
   37.13  
   37.14      func accountHasBeenQualified(trusted: Bool) {
   37.15          guard var theVerificationService = verificationService else {
   37.16 -            Logger.frontendLogger.errorAndCrash("no VerificationService")
   37.17 +            Log.shared.errorAndCrash("no VerificationService")
   37.18              return
   37.19          }
   37.20  
   37.21 @@ -165,7 +165,7 @@
   37.22          do {
   37.23              try theVerificationService.verify()
   37.24          } catch {
   37.25 -            Logger.frontendLogger.error("%{public}@", error.localizedDescription)
   37.26 +            Log.shared.error("%{public}@", error.localizedDescription)
   37.27              loginViewModelLoginErrorDelegate?.handle(loginError: error)
   37.28          }
   37.29      }
   37.30 @@ -223,10 +223,10 @@
   37.31  extension LoginViewModel: VerifiableAccountDelegate {
   37.32      func informAccountVerificationResultDelegate(error: Error?) {
   37.33          guard let theService = verificationService else {
   37.34 -            Logger.frontendLogger.error(
   37.35 +            Log.shared.error(
   37.36                  "Lost the verificationService, was about to inform the delegate")
   37.37              if let err = error {
   37.38 -                Logger.frontendLogger.log(error: err)
   37.39 +                Log.shared.log("%@", err.localizedDescription)
   37.40              }
   37.41              return
   37.42          }
   37.43 @@ -238,9 +238,7 @@
   37.44                  result: .smtpError(smtpError), accountInput: theService)
   37.45          } else {
   37.46              if let theError = error {
   37.47 -                Logger.frontendLogger.log(error: theError)
   37.48 -                Logger.frontendLogger.errorAndCrash("Unexpected error")
   37.49 -
   37.50 +                Log.shared.errorAndCrash("%@", theError.localizedDescription)
   37.51              } else {
   37.52                  accountVerificationResultDelegate?.didVerify(result: .ok, accountInput: theService)
   37.53              }
   37.54 @@ -255,8 +253,7 @@
   37.55                  informAccountVerificationResultDelegate(error: nil)
   37.56                  mySelfer?.startMySelf()
   37.57              } catch {
   37.58 -                Logger.frontendLogger.log(error: error)
   37.59 -                Logger.frontendLogger.errorAndCrash("Unexpected error on saving the account")
   37.60 +                Log.shared.errorAndCrash("%@", error.localizedDescription)
   37.61              }
   37.62          case .failure(let error):
   37.63              informAccountVerificationResultDelegate(error: error)
    38.1 --- a/pEpForiOS/UI/ManualLogin/SMTPSetup/SMTPSettingsTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    38.2 +++ b/pEpForiOS/UI/ManualLogin/SMTPSetup/SMTPSettingsTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    38.3 @@ -151,6 +151,34 @@
    38.4      }
    38.5  }
    38.6  
    38.7 +// MARK: - AccountVerificationServiceDelegate
    38.8 +
    38.9 +extension SMTPSettingsTableViewController: AccountVerificationServiceDelegate {
   38.10 +    func verified(account: Account, service: AccountVerificationServiceProtocol,
   38.11 +                  result: AccountVerificationResult) {
   38.12 +        if result == .ok {
   38.13 +            MessageModelUtil.performAndWait {
   38.14 +                account.save()
   38.15 +            }
   38.16 +        }
   38.17 +        GCD.onMain() {
   38.18 +            self.isCurrentlyVerifying =  false
   38.19 +            switch result {
   38.20 +            case .ok:
   38.21 +                // unwind back to INBOX or folder list on success
   38.22 +                self.performSegue(withIdentifier: .backToEmailListSegue, sender: self)
   38.23 +            case .imapError(let err):
   38.24 +                UIUtils.show(error: err, inViewController: self)
   38.25 +            case .smtpError(let err):
   38.26 +                UIUtils.show(error: err, inViewController: self)
   38.27 +            case .noImapConnectData, .noSmtpConnectData:
   38.28 +                let error = LoginViewController.LoginError.noConnectData
   38.29 +                UIUtils.show(error: error, inViewController: self)
   38.30 +            }
   38.31 +        }
   38.32 +    }
   38.33 +}
   38.34 +
   38.35  // MARK: - SegueHandlerType
   38.36  
   38.37  extension SMTPSettingsTableViewController: SegueHandlerType {
   38.38 @@ -191,9 +219,7 @@
   38.39                      do {
   38.40                          try self?.model.save()
   38.41                      } catch {
   38.42 -                        Logger.frontendLogger.log(error: error)
   38.43 -                        Logger.frontendLogger.errorAndCrash(
   38.44 -                            "Unexpected error on saving the account")
   38.45 +                        Log.shared.errorAndCrash("%@", error.localizedDescription)
   38.46                      }
   38.47                  }
   38.48                  GCD.onMain() {
    39.1 --- a/pEpForiOS/UI/MoveToFolder/ViewModel/MoveToFolderViewModel.swift	Wed May 08 12:23:41 2019 +0200
    39.2 +++ b/pEpForiOS/UI/MoveToFolder/ViewModel/MoveToFolderViewModel.swift	Fri May 10 10:50:12 2019 +0200
    39.3 @@ -87,7 +87,7 @@
    39.4  
    39.5      func moveMessagesTo(index: Int) -> Bool {
    39.6          if !(index >= 0 && index < items.count) {
    39.7 -            Logger.frontendLogger.error("Index out of bounds")
    39.8 +            Log.shared.error("Index out of bounds")
    39.9              return false
   39.10          }
   39.11          let targetFolder = items[index].folder
    40.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    40.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/AccountSettingsTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    40.3 @@ -297,7 +297,7 @@
    40.4  
    40.5  extension AccountSettingsTableViewController {
    40.6      public func handleLoginError(error: Error) {
    40.7 -        Logger.frontendLogger.error("%{public}@", error.localizedDescription)
    40.8 +        Log.shared.error("%{public}@", error.localizedDescription)
    40.9          UIUtils.show(error: error, inViewController: self)
   40.10      }
   40.11  }
    41.1 --- a/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Wed May 08 12:23:41 2019 +0200
    41.2 +++ b/pEpForiOS/UI/Settings/Setting/AccountSettings/ViewModel/AccountSettingsViewModel.swift	Fri May 10 10:50:12 2019 +0200
    41.3 @@ -158,7 +158,7 @@
    41.4          guard let viewModelPort = viewModel.port,
    41.5              let port = UInt16(viewModelPort),
    41.6              let address = viewModel.address else {
    41.7 -                Logger.frontendLogger.errorAndCrash("viewModel misses required data.")
    41.8 +                Log.shared.errorAndCrash("viewModel misses required data.")
    41.9                  return nil
   41.10          }
   41.11          let transport = Server.Transport(fromString: viewModel.transport)
   41.12 @@ -201,7 +201,7 @@
   41.13          }
   41.14          GCD.onMainWait { [weak self] in
   41.15              guard let me = self else {
   41.16 -                Logger.frontendLogger.lostMySelf()
   41.17 +                Log.shared.errorAndCrash("Lost MySelf")
   41.18                  return
   41.19              }
   41.20              me.delegate?.didVerify(result: result, accountInput: nil)
   41.21 @@ -218,8 +218,7 @@
   41.22              do {
   41.23                  try verifiableAccount?.save()
   41.24              } catch {
   41.25 -                Logger.frontendLogger.log(error: error)
   41.26 -                Logger.frontendLogger.errorAndCrash("Unexpected error on saving the account")
   41.27 +                Log.shared.errorAndCrash("%@", error.localizedDescription)
   41.28              }
   41.29          case .failure(let error):
   41.30              if let imapError = error as? ImapSyncError {
   41.31 @@ -229,8 +228,7 @@
   41.32                  delegate?.didVerify(
   41.33                      result: .smtpError(smtpError), accountInput: verifiableAccount)
   41.34              } else {
   41.35 -                Logger.frontendLogger.log(error: error)
   41.36 -                Logger.frontendLogger.errorAndCrash("Unexpected error")
   41.37 +                Log.shared.errorAndCrash("%@", error.localizedDescription)
   41.38              }
   41.39          }
   41.40      }
    42.1 --- a/pEpForiOS/UI/Settings/Setting/LogViewController.swift	Wed May 08 12:23:41 2019 +0200
    42.2 +++ b/pEpForiOS/UI/Settings/Setting/LogViewController.swift	Fri May 10 10:50:12 2019 +0200
    42.3 @@ -16,37 +16,37 @@
    42.4      @IBOutlet weak var switchLabel: UILabel!
    42.5      @IBOutlet weak var enableLogSwitch: UISwitch!
    42.6  
    42.7 -    override func viewWillAppear(_ animated: Bool) {
    42.8 -        super.viewWillAppear(animated)
    42.9 -        Log.checkEnabled() { enabled in
   42.10 -            GCD.onMain {
   42.11 -                self.enableLogSwitch.isOn = enabled
   42.12 -                if self.enableLogSwitch.isOn {
   42.13 -                    let version = (InfoPlist.versionDisplayString() ?? "") + "\n"
   42.14 -                    Log.checklog() { logString in
   42.15 -                        GCD.onMain {
   42.16 -                            self.logTextView.text = version + (logString ?? "")
   42.17 -                        }
   42.18 -                    }
   42.19 -                }
   42.20 -            }
   42.21 -        }
   42.22 -    }
   42.23 +//    override func viewWillAppear(_ animated: Bool) {
   42.24 +//        super.viewWillAppear(animated)
   42.25 +//        Log.checkEnabled() { enabled in
   42.26 +//            GCD.onMain {
   42.27 +//                self.enableLogSwitch.isOn = enabled
   42.28 +//                if self.enableLogSwitch.isOn {
   42.29 +//                    let version = (InfoPlist.versionDisplayString() ?? "") + "\n"
   42.30 +//                    Log.checklog() { logString in
   42.31 +//                        GCD.onMain {
   42.32 +//                            self.logTextView.text = version + (logString ?? "")
   42.33 +//                        }
   42.34 +//                    }
   42.35 +//                }
   42.36 +//            }
   42.37 +//        }
   42.38 +//    }
   42.39  
   42.40      @IBAction func copyAction(_ sender: Any) {
   42.41 -        Log.checklog() { logString in
   42.42 -            GCD.onMain {
   42.43 -                UIPasteboard.general.string = logString
   42.44 -            }
   42.45 -        }
   42.46 +//        Log.checklog() { logString in
   42.47 +//            GCD.onMain {
   42.48 +//                UIPasteboard.general.string = logString
   42.49 +//            }
   42.50 +//        }
   42.51      }
   42.52  
   42.53      @IBAction func enableAction(_ sender: Any) {
   42.54 -        if enableLogSwitch.isOn {
   42.55 -            Log.enableLog()
   42.56 -        } else {
   42.57 -            Log.disableLog()
   42.58 -        }
   42.59 +//        if enableLogSwitch.isOn {
   42.60 +//            Log.enableLog()
   42.61 +//        } else {
   42.62 +//            Log.disableLog()
   42.63 +//        }
   42.64      }
   42.65  }
   42.66  
    43.1 --- a/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewController.swift	Wed May 08 12:23:41 2019 +0200
    43.2 +++ b/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewController.swift	Fri May 10 10:50:12 2019 +0200
    43.3 @@ -58,7 +58,7 @@
    43.4      func trustedServerSettingCell(sender: TrustedServerSettingCell,
    43.5                                    didChangeSwitchValue newValue: Bool) {
    43.6          guard let address = sender.address.text else {
    43.7 -            Logger.frontendLogger.errorAndCrash("No address.")
    43.8 +            Log.shared.errorAndCrash("No address.")
    43.9              return
   43.10          }
   43.11          viewModel.setStoreSecurely(forAccountWith: address , toValue: newValue)
    44.1 --- a/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewModel.swift	Wed May 08 12:23:41 2019 +0200
    44.2 +++ b/pEpForiOS/UI/Settings/Setting/TrustedServerSetting/TrustedServerSettingsViewModel.swift	Fri May 10 10:50:12 2019 +0200
    44.3 @@ -24,7 +24,7 @@
    44.4  
    44.5      mutating func setStoreSecurely(forAccountWith address: String, toValue newValue: Bool) {
    44.6          guard let account = Account.Fetch.accountAllowedToManuallyTrust(fromAddress: address) else {
    44.7 -            Logger.frontendLogger.errorAndCrash("Address should be allowed")
    44.8 +            Log.shared.errorAndCrash("Address should be allowed")
    44.9              return
   44.10          }
   44.11  
   44.12 @@ -44,7 +44,7 @@
   44.13          var createes = [Row]()
   44.14          for account in accounts {
   44.15              guard let isTrusted = account.imapServer?.manuallyTrusted else {
   44.16 -                Logger.frontendLogger.errorAndCrash("Trusted server has no imapServer")
   44.17 +                Log.shared.errorAndCrash("Trusted server has no imapServer")
   44.18                  continue
   44.19              }
   44.20              createes.append(Row(address: account.user.address, storeMessagesSecurely: !isTrusted))
    45.1 --- a/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    45.2 +++ b/pEpForiOS/UI/Settings/SettingsTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    45.3 @@ -105,7 +105,7 @@
    45.4              guard
    45.5                  let vm = viewModel[indexPath.section][indexPath.row] as? SettingsCellViewModel,
    45.6                  let cell = dequeuedCell as? SwipeTableViewCell else {
    45.7 -                    Logger.frontendLogger.errorAndCrash("Invalid state.")
    45.8 +                    Log.shared.errorAndCrash("Invalid state.")
    45.9                      return dequeuedCell
   45.10              }
   45.11              cell.textLabel?.text = vm.title
    46.1 --- a/pEpForiOS/UI/Settings/ViewModel/SettingsCellViewModel.swift	Wed May 08 12:23:41 2019 +0200
    46.2 +++ b/pEpForiOS/UI/Settings/ViewModel/SettingsCellViewModel.swift	Fri May 10 10:50:12 2019 +0200
    46.3 @@ -63,7 +63,7 @@
    46.4                      "Settings: Cell (button) title to view default account setting")
    46.5              case .account:
    46.6                  guard let acc = account else {
    46.7 -                    Logger.frontendLogger.errorAndCrash("Should never be reached")
    46.8 +                    Log.shared.errorAndCrash("Should never be reached")
    46.9                      return nil
   46.10                  }
   46.11                  return acc.user.address
    47.1 --- a/pEpForiOS/UI/SplitView/PrimarySplitViewcontroller+ScreenComposerProtocol.swift	Wed May 08 12:23:41 2019 +0200
    47.2 +++ b/pEpForiOS/UI/SplitView/PrimarySplitViewcontroller+ScreenComposerProtocol.swift	Fri May 10 10:50:12 2019 +0200
    47.3 @@ -26,7 +26,7 @@
    47.4              storyboard.instantiateViewController(withIdentifier: "threadViewController")
    47.5                  as? ThreadViewController
    47.6              else {
    47.7 -                Logger.frontendLogger.errorAndCrash("Segue issue")
    47.8 +                Log.shared.errorAndCrash("Segue issue")
    47.9                  return
   47.10          }
   47.11          vc.appConfig = singleViewController.appConfig
   47.12 @@ -53,7 +53,7 @@
   47.13                  as? EmailViewController,
   47.14              let index = emailListViewModel.index(of: message)
   47.15              else {
   47.16 -                Logger.frontendLogger.errorAndCrash("Segue issues")
   47.17 +                Log.shared.errorAndCrash("Segue issues")
   47.18                  return
   47.19          }
   47.20  
    48.1 --- a/pEpForiOS/UI/Thread/Cells/FullMessageCell.swift	Wed May 08 12:23:41 2019 +0200
    48.2 +++ b/pEpForiOS/UI/Thread/Cells/FullMessageCell.swift	Fri May 10 10:50:12 2019 +0200
    48.3 @@ -119,7 +119,7 @@
    48.4              storyboard.instantiateViewController(withIdentifier: SecureWebViewController.storyboardId)
    48.5                  as? SecureWebViewController
    48.6              else {
    48.7 -                Logger.frontendLogger.errorAndCrash("Cast error")
    48.8 +                Log.shared.errorAndCrash("Cast error")
    48.9                  return SecureWebViewController()
   48.10          }
   48.11          vc.zoomingEnabled = false
    49.1 --- a/pEpForiOS/UI/Thread/ThreadViewController+SegueHandlerType.swift	Wed May 08 12:23:41 2019 +0200
    49.2 +++ b/pEpForiOS/UI/Thread/ThreadViewController+SegueHandlerType.swift	Fri May 10 10:50:12 2019 +0200
    49.3 @@ -28,7 +28,7 @@
    49.4                  let appConfig = self.appConfig,
    49.5                  let indexPath = tableView.indexPathForSelectedRow,
    49.6                  let message = model?.message(at: indexPath.section) else {
    49.7 -                    Logger.frontendLogger.errorAndCrash("Segue issue")
    49.8 +                    Log.shared.errorAndCrash("Segue issue")
    49.9                      return
   49.10              }
   49.11              vc.appConfig = appConfig
   49.12 @@ -41,7 +41,7 @@
   49.13          case .segueShowMoveToFolder:
   49.14              guard  let nav = segue.destination as? UINavigationController,
   49.15                  let destination = nav.topViewController as? MoveToAccountViewController else {
   49.16 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   49.17 +                    Log.shared.errorAndCrash("No DVC?")
   49.18                      break
   49.19              }
   49.20              destination.appConfig = appConfig
   49.21 @@ -54,7 +54,7 @@
   49.22              guard  let nav = segue.destination as? UINavigationController,
   49.23                  let destination = nav.topViewController as? ComposeTableViewController,
   49.24                  let appConfig = appConfig else {
   49.25 -                    Logger.frontendLogger.errorAndCrash("No DVC?")
   49.26 +                    Log.shared.errorAndCrash("No DVC?")
   49.27                      break
   49.28              }
   49.29              destination.appConfig = appConfig
    50.1 --- a/pEpForiOS/UI/Thread/ThreadViewController.swift	Wed May 08 12:23:41 2019 +0200
    50.2 +++ b/pEpForiOS/UI/Thread/ThreadViewController.swift	Fri May 10 10:50:12 2019 +0200
    50.3 @@ -65,7 +65,7 @@
    50.4  
    50.5      func isSplitViewControllerCollapsed() -> Bool! {
    50.6          guard let splitViewController = self.splitViewController else {
    50.7 -            Logger.frontendLogger.errorAndCrash("We need a splitViewController here")
    50.8 +            Log.shared.errorAndCrash("We need a splitViewController here")
    50.9              return nil
   50.10          }
   50.11          return splitViewController.isCollapsed
    51.1 --- a/pEpForiOS/UI/Util/AddToContactsViewController/AddToContactsViewController.swift	Wed May 08 12:23:41 2019 +0200
    51.2 +++ b/pEpForiOS/UI/Util/AddToContactsViewController/AddToContactsViewController.swift	Fri May 10 10:50:12 2019 +0200
    51.3 @@ -26,7 +26,7 @@
    51.4  
    51.5      func setupContactVc() {
    51.6          guard let address = emailAddress else {
    51.7 -            Logger.frontendLogger.errorAndCrash("No data to add?")
    51.8 +            Log.shared.errorAndCrash("No data to add?")
    51.9              dismiss(animated: false)
   51.10              return
   51.11          }
   51.12 @@ -35,7 +35,7 @@
   51.13                                                          value: address as NSString))
   51.14          contactVC = CNContactViewController(forUnknownContact: newContact)
   51.15          guard let contactVC = contactVC else {
   51.16 -            Logger.frontendLogger.errorAndCrash("Missing contactVC")
   51.17 +            Log.shared.errorAndCrash("Missing contactVC")
   51.18              return
   51.19          }
   51.20          contactVC.contactStore = CNContactStore()
    52.1 --- a/pEpForiOS/UI/Util/BaseTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    52.2 +++ b/pEpForiOS/UI/Util/BaseTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    52.3 @@ -17,7 +17,7 @@
    52.4      var appConfig: AppConfig {
    52.5          get {
    52.6              guard let safeConfig = _appConfig else {
    52.7 -                Logger.frontendLogger.errorAndCrash("No appConfig?")
    52.8 +                Log.shared.errorAndCrash("No appConfig?")
    52.9  
   52.10                  // We have no config. Return nonsense.
   52.11                  return AppConfig(
   52.12 @@ -41,7 +41,7 @@
   52.13          super.viewWillAppear(animated)
   52.14          guard _appConfig != nil else {
   52.15              if !MiscUtil.isUnitTest() {
   52.16 -                Logger.frontendLogger.errorAndCrash("AppConfig is nil in viewWillAppear!")
   52.17 +                Log.shared.errorAndCrash("AppConfig is nil in viewWillAppear!")
   52.18              }
   52.19              return
   52.20          }
   52.21 @@ -129,6 +129,6 @@
   52.22  
   52.23  extension BaseTableViewController: KickOffMySelfProtocol {
   52.24      func startMySelf() {
   52.25 -        Logger.frontendLogger.errorAndCrash("No appConfig?")
   52.26 +        Log.shared.errorAndCrash("No appConfig?")
   52.27      }
   52.28  }
    53.1 --- a/pEpForiOS/UI/Util/BaseViewController.swift	Wed May 08 12:23:41 2019 +0200
    53.2 +++ b/pEpForiOS/UI/Util/BaseViewController.swift	Fri May 10 10:50:12 2019 +0200
    53.3 @@ -16,7 +16,7 @@
    53.4      var appConfig: AppConfig! {
    53.5          get {
    53.6              guard _appConfig != nil else {
    53.7 -                Logger.frontendLogger.errorAndCrash("No appConfig?")
    53.8 +                Log.shared.errorAndCrash("No appConfig?")
    53.9                  return nil
   53.10              }
   53.11              return _appConfig
    54.1 --- a/pEpForiOS/UI/Util/Extensions/UIView+Autolayout.swift	Wed May 08 12:23:41 2019 +0200
    54.2 +++ b/pEpForiOS/UI/Util/Extensions/UIView+Autolayout.swift	Fri May 10 10:50:12 2019 +0200
    54.3 @@ -13,7 +13,7 @@
    54.4      /// Sets up constraints to always stay the same size as the superview.
    54.5      public func fullSizeInSuperView() {
    54.6          guard let superview = self.superview else {
    54.7 -            Logger.frontendLogger.errorAndCrash("No superview")
    54.8 +            Log.shared.errorAndCrash("No superview")
    54.9              return
   54.10          }
   54.11  
    55.1 --- a/pEpForiOS/UI/Util/InfoPlist.swift	Wed May 08 12:23:41 2019 +0200
    55.2 +++ b/pEpForiOS/UI/Util/InfoPlist.swift	Fri May 10 10:50:12 2019 +0200
    55.3 @@ -30,7 +30,7 @@
    55.4      
    55.5      static private func mainBundleInfoDictValue(forKey key: String) -> Any? {
    55.6          guard let infoDict = infoDictMainBundle else {
    55.7 -            Logger.utilLogger.errorAndCrash("No info dict")
    55.8 +            Log.shared.errorAndCrash("No info dict")
    55.9              return nil
   55.10          }
   55.11          return infoDict[key]
    56.1 --- a/pEpForiOS/UI/Util/SecureWebViewController/CidHandler.swift	Wed May 08 12:23:41 2019 +0200
    56.2 +++ b/pEpForiOS/UI/Util/SecureWebViewController/CidHandler.swift	Fri May 10 10:50:12 2019 +0200
    56.3 @@ -36,7 +36,7 @@
    56.4              urlSchemeTask.didFinish()
    56.5          }
    56.6          guard let url = urlSchemeTask.request.url else {
    56.7 -            Logger.frontendLogger.errorAndCrash("No URL?")
    56.8 +            Log.shared.errorAndCrash("No URL?")
    56.9              return
   56.10          }
   56.11  
    57.1 --- a/pEpForiOS/UI/Util/SecureWebViewController/SecureWebViewController.swift	Wed May 08 12:23:41 2019 +0200
    57.2 +++ b/pEpForiOS/UI/Util/SecureWebViewController/SecureWebViewController.swift	Fri May 10 10:50:12 2019 +0200
    57.3 @@ -168,13 +168,13 @@
    57.4                  forIdentifier: "pep.security.SecureWebViewController.block_all_external_content",
    57.5                  encodedContentRuleList: blockRules) { (contentRuleList, error) in
    57.6                      if let error = error {
    57.7 -                        Logger.frontendLogger.errorAndCrash(
    57.8 +                        Log.shared.errorAndCrash(
    57.9                              "Compile error: %@", error.localizedDescription)
   57.10                          return
   57.11                      }
   57.12                      compiledBlockList = contentRuleList
   57.13                      guard let _ = compiledBlockList else {
   57.14 -                        Logger.frontendLogger.errorAndCrash(
   57.15 +                        Log.shared.errorAndCrash(
   57.16                              "Emergency exit. External content not blocked.")
   57.17                          completion()
   57.18                          return
   57.19 @@ -228,7 +228,7 @@
   57.20          let handler = {
   57.21              [weak self] (scrollView: UIScrollView, change: NSKeyValueObservedChange<CGSize>) in
   57.22              guard let me = self else {
   57.23 -                Logger.backendLogger.lostMySelf()
   57.24 +                Log.shared.errorAndCrash("Lost MySelf")
   57.25                  return
   57.26              }
   57.27  
   57.28 @@ -376,7 +376,7 @@
   57.29              return
   57.30          case .linkActivated:
   57.31              guard let url = navigationAction.request.url else {
   57.32 -                Logger.frontendLogger.errorAndCrash("Link to nonexisting URL has been clicked?")
   57.33 +                Log.shared.errorAndCrash("Link to nonexisting URL has been clicked?")
   57.34                  break
   57.35              }
   57.36              if url.scheme == "mailto" {
    58.1 --- a/pEpForiOS/UI/Util/SuggestTableViewController/SuggestTableViewController.swift	Wed May 08 12:23:41 2019 +0200
    58.2 +++ b/pEpForiOS/UI/Util/SuggestTableViewController/SuggestTableViewController.swift	Fri May 10 10:50:12 2019 +0200
    58.3 @@ -34,7 +34,7 @@
    58.4  extension SuggestTableViewController {
    58.5      override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    58.6          guard let viewModel = viewModel else {
    58.7 -            Logger.frontendLogger.errorAndCrash("No VM")
    58.8 +            Log.shared.errorAndCrash("No VM")
    58.9              return
   58.10          }
   58.11          viewModel.handleRowSelected(at: indexPath.row)
   58.12 @@ -48,7 +48,7 @@
   58.13      public override func tableView(_ tableView: UITableView,
   58.14                                     numberOfRowsInSection section: Int) -> Int {
   58.15          guard let viewModel = viewModel else {
   58.16 -            Logger.frontendLogger.errorAndCrash("No VM")
   58.17 +            Log.shared.errorAndCrash("No VM")
   58.18              return 0
   58.19          }
   58.20          return viewModel.numRows
   58.21 @@ -61,7 +61,7 @@
   58.22              let cell = tableView.dequeueReusableCell(withIdentifier: ContactCell.reuseId,
   58.23                                                         for: indexPath)
   58.24              as? ContactCell else {
   58.25 -                Logger.frontendLogger.errorAndCrash("Illegal state")
   58.26 +                Log.shared.errorAndCrash("Illegal state")
   58.27                  return UITableViewCell()
   58.28          }
   58.29          let row = viewModel.row(at: indexPath.row)
    59.1 --- a/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Wed May 08 12:23:41 2019 +0200
    59.2 +++ b/pEpForiOS/UI/Util/SuggestTableViewController/SuggestViewModel.swift	Fri May 10 10:50:12 2019 +0200
    59.3 @@ -54,7 +54,7 @@
    59.4  
    59.5      public func handleRowSelected(at index: Int) {
    59.6          guard index < identities.count else {
    59.7 -            Logger.frontendLogger.errorAndCrash("Out of bounds")
    59.8 +            Log.shared.errorAndCrash("Out of bounds")
    59.9              return
   59.10          }
   59.11          resultDelegate?.suggestViewModelDidSelectContact(identity: identities[index])
   59.12 @@ -66,7 +66,7 @@
   59.13  
   59.14      public func row(at index: Int) -> Row {
   59.15          guard index < identities.count else {
   59.16 -            Logger.frontendLogger.errorAndCrash("Index out of bounds")
   59.17 +            Log.shared.errorAndCrash("Index out of bounds")
   59.18              return Row(name: "Problem", email: "child")
   59.19          }
   59.20          let identity = identities[index]
    60.1 --- a/pEpForiOS/UI/Util/UIUtils.swift	Wed May 08 12:23:41 2019 +0200
    60.2 +++ b/pEpForiOS/UI/Util/UIUtils.swift	Fri May 10 10:50:12 2019 +0200
    60.3 @@ -19,7 +19,7 @@
    60.4      ///   - error: error to preset to user
    60.5      ///   - vc: ViewController to present the error on
    60.6      static func show(error: Error, inViewController vc: UIViewController) {
    60.7 -//        Logger.utilLogger.errorAndCrash("Will display error to user: %@",
    60.8 +//        Log.shared.errorAndCrash("Will display error to user: %@",
    60.9  //                                                    error.localizedDescription)
   60.10          guard let displayError = DisplayUserError(withError: error) else {
   60.11              // Do nothing. The error type is not suitable to bother the user with.
   60.12 @@ -92,7 +92,7 @@
   60.13              let composeVc = composeNavigationController.rootViewController
   60.14                  as? ComposeTableViewController
   60.15              else {
   60.16 -                Logger.utilLogger.errorAndCrash("Missing required data")
   60.17 +                Log.shared.errorAndCrash("Missing required data")
   60.18                  return
   60.19          }
   60.20          var prefilledTo: Identity? = nil
   60.21 @@ -124,7 +124,7 @@
   60.22          let storyboard = UIStoryboard(name: Constants.addToContactsStoryboard, bundle: nil)
   60.23          guard let contactVc = storyboard.instantiateViewController(withIdentifier:
   60.24              AddToContactsViewController.storyboardId) as? AddToContactsViewController else {
   60.25 -                Logger.utilLogger.errorAndCrash("Missing required data")
   60.26 +                Log.shared.errorAndCrash("Missing required data")
   60.27                  return
   60.28          }
   60.29          contactVc.appConfig = appConfig
   60.30 @@ -148,11 +148,11 @@
   60.31                                                       at view: UIView,
   60.32                                                       appConfig: AppConfig) {
   60.33          guard let _ = UrlClickHandler.Scheme(for: url) else {
   60.34 -            Logger.utilLogger.errorAndCrash("Unsupported scheme")
   60.35 +            Log.shared.errorAndCrash("Unsupported scheme")
   60.36              return
   60.37          }
   60.38          guard let address = url.firstRecipientAddress() else {
   60.39 -            Logger.utilLogger.errorAndCrash("No address")
   60.40 +            Log.shared.errorAndCrash("No address")
   60.41              return
   60.42          }
   60.43          presentActionSheetWithContactOptions(forContactWithEmailAddress: address,
   60.44 @@ -239,7 +239,7 @@
   60.45  
   60.46      static func presentSettings(on viewController: UIViewController, appConfig: AppConfig) {
   60.47          guard let vc = UIStoryboard.init(name: "Settings", bundle: Bundle.main).instantiateViewController(withIdentifier: SettingsTableViewController.storyboardId) as? SettingsTableViewController else {
   60.48 -            Logger.utilLogger.errorAndCrash("No controller")
   60.49 +            Log.shared.errorAndCrash("No controller")
   60.50              return
   60.51          }
   60.52          vc.appConfig = appConfig
    61.1 --- a/pEpForiOS/Util/DebugMergePolicy.swift	Wed May 08 12:23:41 2019 +0200
    61.2 +++ b/pEpForiOS/Util/DebugMergePolicy.swift	Fri May 10 10:50:12 2019 +0200
    61.3 @@ -38,7 +38,7 @@
    61.4                  for c in conflictingObjects {
    61.5                      logString += "\n* \(c.keyPath):\n\(String(describing: c.o1))\n->\n\(String(describing: c.o2))"
    61.6                  }
    61.7 -                Logger.utilLogger.error("%{public}@", logString)
    61.8 +                Log.shared.error("%{public}@", logString)
    61.9              }
   61.10          }
   61.11      }
    62.1 --- a/pEpForiOS/Util/Extensions/ConnectionTransport+AccountSettings.swift	Wed May 08 12:23:41 2019 +0200
    62.2 +++ b/pEpForiOS/Util/Extensions/ConnectionTransport+AccountSettings.swift	Fri May 10 10:50:12 2019 +0200
    62.3 @@ -18,7 +18,7 @@
    62.4          case .startTLS: self = .startTLS
    62.5          case .TLS: self = .TLS
    62.6          case .unknown:
    62.7 -            Logger.utilLogger.errorAndCrash(
    62.8 +            Log.shared.errorAndCrash(
    62.9                  "Unsupported LAS transport: %d", accountSettingsTransport.rawValue)
   62.10              self = .plain
   62.11          }
    63.1 --- a/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Wed May 08 12:23:41 2019 +0200
    63.2 +++ b/pEpForiOS/Util/Extensions/PEP_rating+Extension.swift	Fri May 10 10:50:12 2019 +0200
    63.3 @@ -31,7 +31,7 @@
    63.4               .underAttack:
    63.5              return false
    63.6          default:
    63.7 -            Logger.utilLogger.errorAndCrash(
    63.8 +            Log.shared.errorAndCrash(
    63.9                  "cannot decide isUnderAttack() for %{public}@", self.rawValue)
   63.10              return false
   63.11          }
   63.12 @@ -57,7 +57,7 @@
   63.13               .underAttack:
   63.14              return false
   63.15          default:
   63.16 -            Logger.utilLogger.errorAndCrash(
   63.17 +            Log.shared.errorAndCrash(
   63.18                  "cannot decide isUnderAttack() for %{public}@", self.rawValue)
   63.19              return false
   63.20          }
    64.1 --- a/pEpForiOS/Util/Log/Log+ASL.swift	Wed May 08 12:23:41 2019 +0200
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,213 +0,0 @@
    64.4 -//
    64.5 -//  Log+ASL.swift
    64.6 -//  pEp
    64.7 -//
    64.8 -//  Created by Dirk Zimmermann on 03.10.18.
    64.9 -//  Copyright © 2018 p≡p Security S.A. All rights reserved.
   64.10 -//
   64.11 -
   64.12 -import Foundation
   64.13 -import asl
   64.14 -
   64.15 -class ASLLogger: ActualLoggerProtocol {
   64.16 -    func saveLog(severity: LoggingSeverity,
   64.17 -                 entity: String,
   64.18 -                 description: String,
   64.19 -                 comment: String) {
   64.20 -        let logMessage = asl_new(UInt32(ASL_TYPE_MSG))
   64.21 -
   64.22 -        asl_set(logMessage, ASL_KEY_SENDER, sender)
   64.23 -        asl_set(logMessage, ASL_KEY_FACILITY, entity)
   64.24 -        asl_set(logMessage, ASL_KEY_MSG, "\(description) [\(comment)]")
   64.25 -        asl_set(logMessage, ASL_KEY_LEVEL, "\(severity.aslLevel())")
   64.26 -
   64.27 -        let nowDate = Date()
   64.28 -        let dateString = "\(Int(nowDate.timeIntervalSince1970))"
   64.29 -        asl_set(logMessage, ASL_KEY_TIME, dateString)
   64.30 -
   64.31 -        asl_set(logMessage, ASL_KEY_READ_UID, "-1")
   64.32 -
   64.33 -        asl_send(self.consoleClient, logMessage)
   64.34 -        asl_free(logMessage)
   64.35 -    }
   64.36 -
   64.37 -    func retrieveLog() -> String {
   64.38 -        let query = asl_new(UInt32(ASL_TYPE_QUERY))
   64.39 -
   64.40 -        var result = asl_set_query(
   64.41 -            query,
   64.42 -            ASL_KEY_SENDER,
   64.43 -            sender,
   64.44 -            UInt32(ASL_QUERY_OP_EQUAL))
   64.45 -        ASLLogger.checkASLSuccess(result: result, comment: "asl_set_query ASL_KEY_SENDER")
   64.46 -
   64.47 -        let fromDate = Date(timeInterval: -600, since: Date())
   64.48 -        let fromDateString = "\(Int(fromDate.timeIntervalSince1970))"
   64.49 -        result = asl_set_query(
   64.50 -            query,
   64.51 -            ASL_KEY_TIME,
   64.52 -            fromDateString,
   64.53 -            UInt32(ASL_QUERY_OP_GREATER_EQUAL))
   64.54 -        ASLLogger.checkASLSuccess(result: result, comment: "asl_set_query ASL_KEY_TIME")
   64.55 -
   64.56 -        let theClient = createConsoleLogger()
   64.57 -
   64.58 -        let response = asl_search(theClient, query)
   64.59 -        var next = asl_next(response)
   64.60 -        var logString = ""
   64.61 -        while next != nil {
   64.62 -            let timeString = String(cString: asl_get(next, ASL_KEY_TIME))
   64.63 -            let messageString = String(cString: asl_get(next, ASL_KEY_MSG))
   64.64 -            let facilityString = String(cString: asl_get(next, ASL_KEY_FACILITY))
   64.65 -            let levelString = String(cString: asl_get(next, ASL_KEY_LEVEL))
   64.66 -
   64.67 -            let level = levelString.aslLevelStringToASL()
   64.68 -            let ownLevelString = level.criticalityString()
   64.69 -
   64.70 -            var dateString = "<NoTime>"
   64.71 -            if let dateInt = Int(timeString) {
   64.72 -                let date = Date(timeIntervalSince1970: TimeInterval(dateInt))
   64.73 -                dateString = "\(date)"
   64.74 -            }
   64.75 -
   64.76 -            if !logString.isEmpty {
   64.77 -                logString.append("\n")
   64.78 -            }
   64.79 -
   64.80 -            let stringToLog = "\(dateString) [\(ownLevelString)] [\(facilityString)] \(messageString)"
   64.81 -            logString.append(stringToLog)
   64.82 -
   64.83 -            next = asl_next(response)
   64.84 -        }
   64.85 -
   64.86 -        asl_free(query)
   64.87 -        asl_free(response)
   64.88 -        asl_free(theClient)
   64.89 -
   64.90 -        return logString
   64.91 -    }
   64.92 -
   64.93 -    init() {
   64.94 -        self.consoleClient = createConsoleLogger()
   64.95 -    }
   64.96 -
   64.97 -    deinit {
   64.98 -        asl_release(consoleClient)
   64.99 -    }
  64.100 -
  64.101 -    private let sender = "security.pEp.app.iOS"
  64.102 -
  64.103 -    private var consoleClient: aslclient?
  64.104 -
  64.105 -    private func createConsoleLogger() -> asl_object_t {
  64.106 -        return asl_open(self.sender, "default", 0)
  64.107 -    }
  64.108 -
  64.109 -    private static func checkASLSuccess(result: Int32, comment: String) {
  64.110 -        if result != 0 {
  64.111 -            print("error: \(comment)")
  64.112 -        }
  64.113 -    }
  64.114 -}
  64.115 -
  64.116 -extension LoggingSeverity {
  64.117 -    /**
  64.118 -     Maps the internal criticality of a log  message into a subsystem of ASL levels.
  64.119 -
  64.120 -     ASL has the following:
  64.121 -     * ASL_LEVEL_EMERG
  64.122 -     * ASL_LEVEL_ALERT
  64.123 -     * ASL_LEVEL_CRIT
  64.124 -     * ASL_LEVEL_ERR
  64.125 -     * ASL_LEVEL_WARNING
  64.126 -     * ASL_LEVEL_NOTICE
  64.127 -     * ASL_LEVEL_INFO
  64.128 -     * ASL_LEVEL_DEBUG
  64.129 -     */
  64.130 -    func aslLevel() -> Int32 {
  64.131 -        switch self {
  64.132 -        case .verbose:
  64.133 -            return ASL_LEVEL_DEBUG
  64.134 -        case .info:
  64.135 -            return ASL_LEVEL_NOTICE
  64.136 -        case .warning:
  64.137 -            return ASL_LEVEL_WARNING
  64.138 -        case .error:
  64.139 -            return ASL_LEVEL_ERR
  64.140 -        }
  64.141 -    }
  64.142 -}
  64.143 -
  64.144 -extension String {
  64.145 -    func aslLevelStringToASL() -> Int32 {
  64.146 -        switch self {
  64.147 -        case "0":
  64.148 -            return ASL_LEVEL_EMERG
  64.149 -        case "1":
  64.150 -            return ASL_LEVEL_ALERT
  64.151 -        case "2":
  64.152 -            return ASL_LEVEL_CRIT
  64.153 -        case "3":
  64.154 -            return ASL_LEVEL_ERR
  64.155 -        case "4":
  64.156 -            return ASL_LEVEL_WARNING
  64.157 -        case "5":
  64.158 -            return ASL_LEVEL_NOTICE
  64.159 -        case "6":
  64.160 -            return ASL_LEVEL_INFO
  64.161 -        case "7":
  64.162 -            return ASL_LEVEL_DEBUG
  64.163 -
  64.164 -        default:
  64.165 -            return ASL_LEVEL_DEBUG
  64.166 -        }
  64.167 -    }
  64.168 -}
  64.169 -
  64.170 -extension Int32 {
  64.171 -    func criticalityString() -> String {
  64.172 -        switch self {
  64.173 -        case ASL_LEVEL_EMERG:
  64.174 -            return "EMERG"
  64.175 -        case ASL_LEVEL_ALERT:
  64.176 -            return "ALERT"
  64.177 -        case ASL_LEVEL_CRIT:
  64.178 -            return "CRIT"
  64.179 -        case ASL_LEVEL_ERR:
  64.180 -            return "ERR"
  64.181 -        case ASL_LEVEL_WARNING:
  64.182 -            return "WARNING"
  64.183 -        case ASL_LEVEL_NOTICE:
  64.184 -            return "NOTICE"
  64.185 -        case ASL_LEVEL_INFO:
  64.186 -            return "INFO"
  64.187 -        case ASL_LEVEL_DEBUG:
  64.188 -            return "DEBUG"
  64.189 -        default:
  64.190 -            return "UNKNOWN"
  64.191 -        }
  64.192 -    }
  64.193 -
  64.194 -    func aslLevelString() -> String {
  64.195 -        switch self {
  64.196 -        case ASL_LEVEL_EMERG:
  64.197 -            return "ASL_LEVEL_EMERG"
  64.198 -        case ASL_LEVEL_ALERT:
  64.199 -            return "ASL_LEVEL_ALERT"
  64.200 -        case ASL_LEVEL_CRIT:
  64.201 -            return "ASL_LEVEL_CRIT"
  64.202 -        case ASL_LEVEL_ERR:
  64.203 -            return "ASL_LEVEL_ERR"
  64.204 -        case ASL_LEVEL_WARNING:
  64.205 -            return "ASL_LEVEL_WARNING"
  64.206 -        case ASL_LEVEL_NOTICE:
  64.207 -            return "ASL_LEVEL_NOTICE"
  64.208 -        case ASL_LEVEL_INFO:
  64.209 -            return "ASL_LEVEL_INFO"
  64.210 -        case ASL_LEVEL_DEBUG:
  64.211 -            return "ASL_LEVEL_DEBUG"
  64.212 -        default:
  64.213 -            return "ASL_LEVEL_UNKNOWN"
  64.214 -        }
  64.215 -    }
  64.216 -}
    65.1 --- a/pEpForiOS/Util/Log/Log.swift	Wed May 08 12:23:41 2019 +0200
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,208 +0,0 @@
    65.4 -//
    65.5 -//  Log.swift
    65.6 -//  pEpForiOS
    65.7 -//
    65.8 -//  Created by Dirk Zimmermann on 08/04/16.
    65.9 -//  Copyright © 2016 p≡p Security S.A. All rights reserved.
   65.10 -//
   65.11 -
   65.12 -import os.log
   65.13 -
   65.14 -import MessageModel
   65.15 -
   65.16 -enum LoggingSeverity {
   65.17 -    case verbose
   65.18 -    case info
   65.19 -    case warning
   65.20 -    case error
   65.21 -}
   65.22 -
   65.23 -/**
   65.24 - Handling the actual logging.
   65.25 - */
   65.26 -protocol ActualLoggerProtocol {
   65.27 -    func saveLog(severity: LoggingSeverity,
   65.28 -                 entity: String,
   65.29 -                 description: String,
   65.30 -                 comment: String)
   65.31 -
   65.32 -    func retrieveLog() -> String
   65.33 -}
   65.34 -
   65.35 -/** Very primitive Logging class. */
   65.36 -@objc open class Log: NSObject {
   65.37 -    static public let shared: Log = {
   65.38 -        let instance = Log()
   65.39 -        return instance
   65.40 -    }()
   65.41 -
   65.42 -    static public func disableLog() {
   65.43 -        Log.shared.loggingQueue.addOperation() {
   65.44 -            Log.shared.logEnabled = false
   65.45 -        }
   65.46 -    }
   65.47 -
   65.48 -    static public func enableLog() {
   65.49 -        Log.shared.loggingQueue.addOperation() {
   65.50 -            Log.shared.logEnabled = true
   65.51 -        }
   65.52 -    }
   65.53 -
   65.54 -    static public func checkEnabled(_ block: ((Bool) -> ())?) {
   65.55 -        Log.shared.loggingQueue.addOperation() {
   65.56 -            let b = Log.shared.logEnabled
   65.57 -            block?(b)
   65.58 -        }
   65.59 -    }
   65.60 -
   65.61 -    static public func checklog(_ block: ((String?) -> ())?) {
   65.62 -        Log.shared.loggingQueue.addOperation() {
   65.63 -            let logString = Log.shared.internalLogger.retrieveLog()
   65.64 -            block?(logString)
   65.65 -        }
   65.66 -    }
   65.67 -
   65.68 -    static public func verbose(component: String, content: String) {
   65.69 -        Log.shared.saveLog(severity:.verbose,
   65.70 -                           entity: component, description: content, comment: "verbose")
   65.71 -    }
   65.72 -
   65.73 -    /** Somewhat verbose */
   65.74 -    static public func info(component: String, content: String) {
   65.75 -        Log.shared.saveLog(severity:.info,
   65.76 -                           entity: component, description: content, comment: "info")
   65.77 -    }
   65.78 -
   65.79 -    /** More important */
   65.80 -    static public func warn(component: String, content: String) {
   65.81 -        Log.shared.saveLog(severity:.warning,
   65.82 -                           entity: component, description: content, comment: "warn")
   65.83 -    }
   65.84 -
   65.85 -    static public func error(component: String, error: Error?) {
   65.86 -        if let err = error {
   65.87 -            Log.shared.saveLog(severity:.error,
   65.88 -                               entity: component, description: " \(err)", comment: "error")
   65.89 -        }
   65.90 -    }
   65.91 -
   65.92 -    static public func error(component: String, errorString: String, error: Error) {
   65.93 -        Log.shared.saveLog(severity:.error,
   65.94 -                           entity: component, description: "\(errorString) \(error)", comment: "error")
   65.95 -    }
   65.96 -
   65.97 -    static public func error(component: String, errorString: String) {
   65.98 -        Log.shared.saveLog(severity:.error,
   65.99 -                           entity: component, description: errorString, comment: "error")
  65.100 -    }
  65.101 -
  65.102 -    public static func log(comp: String, mySelf: AnyObject, functionName: String) {
  65.103 -        let selfDesc = unsafeBitCast(mySelf, to: UnsafeRawPointer.self)
  65.104 -        Log.shared.info(component: comp, content: "\(functionName): \(selfDesc)")
  65.105 -    }
  65.106 -
  65.107 -    public func resume() {
  65.108 -        Log.shared.paused = false
  65.109 -    }
  65.110 -
  65.111 -    public func pause() {
  65.112 -        Log.shared.paused = true
  65.113 -        Log.shared.loggingQueue.cancelAllOperations()
  65.114 -    }
  65.115 -
  65.116 -    private let title = "pEpForiOS"
  65.117 -    private var logEnabled = true
  65.118 -    private var paused = false
  65.119 -
  65.120 -    private let loggingQueue: OperationQueue = {
  65.121 -        let createe = OperationQueue()
  65.122 -        createe.qualityOfService = .background
  65.123 -        createe.maxConcurrentOperationCount = 1
  65.124 -        return createe
  65.125 -    }()
  65.126 -
  65.127 -    private let internalLogger = ASLLogger()
  65.128 -
  65.129 -    /**
  65.130 -     Prints and/or saves a log entry.
  65.131 -     - Note: For a log to be printed, the entity must be contained in `allowedEntities`,
  65.132 -     or the severity must be noted in `allowedSeverities`.
  65.133 -     */
  65.134 -    private func saveLog(severity: LoggingSeverity,
  65.135 -                         entity: String,
  65.136 -                         description: String,
  65.137 -                         comment: String) {
  65.138 -        let allowedEntities = Set<String>(["CWIMAPStore", "ImapSync"])
  65.139 -        let allowedSeverities = Set<LoggingSeverity>([.error, .warning, .info])
  65.140 -
  65.141 -        if allowedSeverities.contains(severity) || allowedEntities.contains(entity) {
  65.142 -            internalLogger.saveLog(severity: severity,
  65.143 -                                   entity: entity,
  65.144 -                                   description: description,
  65.145 -                                   comment: comment)
  65.146 -        }
  65.147 -    }
  65.148 -}
  65.149 -
  65.150 -extension Log: MessageModelLogging {
  65.151 -    public func verbose(component: String, content: String) {
  65.152 -        Log.verbose(component: component, content: content)
  65.153 -    }
  65.154 -
  65.155 -    public func info(component: String, content: String) {
  65.156 -        Log.info(component: component, content: content)
  65.157 -    }
  65.158 -
  65.159 -    public func warn(component: String, content: String) {
  65.160 -        Log.warn(component: component, content: content)
  65.161 -    }
  65.162 -
  65.163 -    public func error(component: String, error: Error) {
  65.164 -        Log.error(component: component, error: error)
  65.165 -    }
  65.166 -
  65.167 -    public func error(component: String, errorString: String, error: Error) {
  65.168 -        Log.error(component: component, errorString: errorString, error: error)
  65.169 -    }
  65.170 -
  65.171 -    public func error(component: String, errorString: String) {
  65.172 -        Log.error(component: component, errorString: errorString)
  65.173 -    }
  65.174 -
  65.175 -    /// Logs component and error.
  65.176 -    ///
  65.177 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  65.178 -    ///
  65.179 -    /// - Parameters:
  65.180 -    ///   - component: caller information to log
  65.181 -    ///   - error: error to log
  65.182 -    public func errorAndCrash(component: String, error: Error) {
  65.183 -        Log.error(component: component, error: error)
  65.184 -        SystemUtils.crash("ERROR \(component): \(error.localizedDescription)")
  65.185 -    }
  65.186 -
  65.187 -    /// Logs component and error.
  65.188 -    ///
  65.189 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  65.190 -    ///
  65.191 -    /// - Parameters:
  65.192 -    ///   - component: caller information to log
  65.193 -    ///   - errorString: error information to log
  65.194 -    ///   - error: error to log
  65.195 -    public func errorAndCrash(component: String, errorString: String, error: Error) {
  65.196 -        Log.error(component: component, errorString: errorString, error: error)
  65.197 -        SystemUtils.crash("ERROR \(component): \(errorString): \(error.localizedDescription)")
  65.198 -    }
  65.199 -
  65.200 -    /// Logs component and error.
  65.201 -    ///
  65.202 -    /// - note: If (and only if) in DEBUG configuration, it also calls fatalError().
  65.203 -    ///
  65.204 -    /// - Parameters:
  65.205 -    ///   - component: caller information to log
  65.206 -    ///   - errorString: error information to log
  65.207 -    public func errorAndCrash(component: String, errorString: String) {
  65.208 -        Log.error(component: component, errorString: errorString)
  65.209 -        SystemUtils.crash("ERROR \(component): \(errorString)")
  65.210 -    }
  65.211 -}
    66.1 --- a/pEpForiOS/Util/ReferenceCounter.swift	Wed May 08 12:23:41 2019 +0200
    66.2 +++ b/pEpForiOS/Util/ReferenceCounter.swift	Fri May 10 10:50:12 2019 +0200
    66.3 @@ -59,7 +59,7 @@
    66.4      public static func logOutstanding() {
    66.5          for (_, entry) in table {
    66.6              if entry.count != 0 {
    66.7 -                Logger.utilLogger.warn("%{public}@", entry.description)
    66.8 +                Log.shared.warn("%{public}@", entry.description)
    66.9              }
   66.10          }
   66.11      }
    67.1 --- a/pEpForiOS/Util/UserNotificationTool.swift	Wed May 08 12:23:41 2019 +0200
    67.2 +++ b/pEpForiOS/Util/UserNotificationTool.swift	Fri May 10 10:50:12 2019 +0200
    67.3 @@ -64,7 +64,7 @@
    67.4                                                  content: content, trigger: trigger)
    67.5              center.add(request) { (error) in
    67.6                  if let error = error {
    67.7 -                    Logger.utilLogger.warn(
    67.8 +                    Log.shared.warn(
    67.9                          "Error posting user notification: %{public}@",
   67.10                          error.localizedDescription)
   67.11                  }
    68.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox.xcodeproj/project.pbxproj	Wed May 08 12:23:41 2019 +0200
    68.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox.xcodeproj/project.pbxproj	Fri May 10 10:50:12 2019 +0200
    68.3 @@ -14,6 +14,7 @@
    68.4  		37904565223FA486006DAB3B /* ReachabilityProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37904561223FA486006DAB3B /* ReachabilityProtocol.swift */; };
    68.5  		37904569223FA52B006DAB3B /* NetworkReachibilityMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37904567223FA52B006DAB3B /* NetworkReachibilityMock.swift */; };
    68.6  		3790456A223FA52B006DAB3B /* ReachabilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37904568223FA52B006DAB3B /* ReachabilityTests.swift */; };
    68.7 +		37954C6E227C90C10099B8D8 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37954C6D227C90C10099B8D8 /* Log.swift */; };
    68.8  		435F5129221FF9D7006EB11F /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 435F5128221FF9D7006EB11F /* Constants.swift */; };
    68.9  		B70A3A5522005BD400EDCE61 /* Date+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A5422005BD400EDCE61 /* Date+Extension.swift */; };
   68.10  		B70A3A5722005BE300EDCE61 /* NSRegularExpression+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B70A3A5622005BE300EDCE61 /* NSRegularExpression+Extension.swift */; };
   68.11 @@ -62,6 +63,7 @@
   68.12  		37904561223FA486006DAB3B /* ReachabilityProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReachabilityProtocol.swift; sourceTree = "<group>"; };
   68.13  		37904567223FA52B006DAB3B /* NetworkReachibilityMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachibilityMock.swift; sourceTree = "<group>"; };
   68.14  		37904568223FA52B006DAB3B /* ReachabilityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReachabilityTests.swift; sourceTree = "<group>"; };
   68.15 +		37954C6D227C90C10099B8D8 /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = "<group>"; };
   68.16  		435F5128221FF9D7006EB11F /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Constants.swift; path = ../../../../Submodules/pEpIOSToolbox/pEpIOSToolbox/Other/Constants.swift; sourceTree = "<group>"; };
   68.17  		B70A3A5422005BD400EDCE61 /* Date+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Date+Extension.swift"; sourceTree = "<group>"; };
   68.18  		B70A3A5622005BE300EDCE61 /* NSRegularExpression+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSRegularExpression+Extension.swift"; sourceTree = "<group>"; };
   68.19 @@ -165,6 +167,14 @@
   68.20  			path = ReachabilityUtilsTest;
   68.21  			sourceTree = "<group>";
   68.22  		};
   68.23 +		37C3C0E72264BF96003E290C /* Modules */ = {
   68.24 +			isa = PBXGroup;
   68.25 +			children = (
   68.26 +				37954C6D227C90C10099B8D8 /* Log.swift */,
   68.27 +			);
   68.28 +			path = Modules;
   68.29 +			sourceTree = "<group>";
   68.30 +		};
   68.31  		B70A3A5222005A7600EDCE61 /* Foundation */ = {
   68.32  			isa = PBXGroup;
   68.33  			children = (
   68.34 @@ -218,6 +228,7 @@
   68.35  		B7911EB621F7358500D7F66F /* pEpIOSToolbox */ = {
   68.36  			isa = PBXGroup;
   68.37  			children = (
   68.38 +				37C3C0E72264BF96003E290C /* Modules */,
   68.39  				B70A3A5222005A7600EDCE61 /* Foundation */,
   68.40  				B70A3A5322005B9600EDCE61 /* UIKit */,
   68.41  				B7DB7FEC221B086A003968DA /* Other */,
   68.42 @@ -369,6 +380,7 @@
   68.43  				B7A46C54220C73BE0027CCB5 /* String+Extensions.swift in Sources */,
   68.44  				B7A46C58220DA6190027CCB5 /* String+Email.swift in Sources */,
   68.45  				37904565223FA486006DAB3B /* ReachabilityProtocol.swift in Sources */,
   68.46 +				37954C6E227C90C10099B8D8 /* Log.swift in Sources */,
   68.47  				B7A46C62220DCEA80027CCB5 /* NSAttributedString+Parsing.swift in Sources */,
   68.48  				B7465DE72211E969008A1708 /* CGRect+Util.swift in Sources */,
   68.49  				B7465DCC2211BEEA008A1708 /* Tuple.swift in Sources */,
    69.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Wed May 08 12:23:41 2019 +0200
    69.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/Data+Extensions.swift	Fri May 10 10:50:12 2019 +0200
    69.3 @@ -30,7 +30,7 @@
    69.4          do {
    69.5              try write(to: url)
    69.6          } catch {
    69.7 -            Logger.utilLogger.error("Could not save to %{public}@", url.absoluteString)
    69.8 +            Log.shared.error("Could not save to %{public}@", url.absoluteString)
    69.9          }
   69.10      }
   69.11  
   69.12 @@ -40,7 +40,7 @@
   69.13                  withJSONObject: self, options: .prettyPrinted)
   69.14              jsonData.debugSave(basePath: basePath, fileName: fileName, ext: ext)
   69.15          } catch let err {
   69.16 -            Logger.utilLogger.error("%{public}@", err.localizedDescription)
   69.17 +            Log.shared.error("%{public}@", err.localizedDescription)
   69.18          }
   69.19      }
   69.20  }
    70.1 --- a/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift	Wed May 08 12:23:41 2019 +0200
    70.2 +++ b/subModules/pEpIOSToolbox/pEpIOSToolbox/Foundation/String+Extensions.swift	Fri May 10 10:50:12 2019 +0200
    70.3 @@ -152,7 +152,7 @@
    70.4                                                      range: range,
    70.5                                                      withTemplate: replacee)
    70.6          } catch {
    70.7 -            Logger.utilLogger.errorAndCrash("Catched!")
    70.8 +            Log.shared.errorAndCrash("Catched!")
    70.9              return result
   70.10          }
   70.11          return result
   70.12 @@ -178,7 +178,7 @@
   70.13              let matches = regex.matches(in: self, options: [], range: wholeRange())
   70.14              return matches.count > 0
   70.15          } catch {
   70.16 -            Logger.utilLogger.errorAndCrash("%{public}@", error.localizedDescription)
   70.17 +            Log.shared.errorAndCrash("%{public}@", error.localizedDescription)
   70.18          }
   70.19          return false
   70.20      }
   70.21 @@ -209,7 +209,7 @@
   70.22                  }
   70.23              }
   70.24          } catch {
   70.25 -            Logger.utilLogger.errorAndCrash("%{public}@",
   70.26 +            Log.shared.errorAndCrash("%{public}@",
   70.27                                                          error.localizedDescription)
   70.28          }
   70.29          return self
   70.30 @@ -233,7 +233,7 @@
   70.31                  }
   70.32              }
   70.33          } catch {
   70.34 -            Logger.utilLogger.errorAndCrash("%{public}@",
   70.35 +            Log.shared.errorAndCrash("%{public}@",
   70.36                                                          error.localizedDescription)
   70.37          }
   70.38          return self