Просмотр исходного кода

Drop banner side-effect from Logger.info(); log-only now

trioneer недель назад: 2
Родитель
Сommit
f9148f7763
1 измененных файлов с 1 добавлено и 47 удалено
  1. 1 47
      Trio/Sources/Logger/Logger.swift

+ 1 - 47
Trio/Sources/Logger/Logger.swift

@@ -5,7 +5,6 @@ import UIKit
 var LoggerTestMode = false
 var LoggerTestMode = false
 
 
 private let baseReporter = TrioApp.resolver.resolve(GroupedIssueReporter.self)!
 private let baseReporter = TrioApp.resolver.resolve(GroupedIssueReporter.self)!
-private let router = TrioApp.resolver.resolve(Router.self)!
 
 
 let loggerLock = NSRecursiveLock()
 let loggerLock = NSRecursiveLock()
 
 
@@ -28,37 +27,13 @@ func debug(
 func info(
 func info(
     _ category: Logger.Category,
     _ category: Logger.Category,
     _ message: String,
     _ message: String,
-    type: MessageType = .info,
     file: String = #file,
     file: String = #file,
     function: String = #function,
     function: String = #function,
     line: UInt = #line
     line: UInt = #line
 ) {
 ) {
     DispatchWorkItem(qos: .background, flags: .enforceQoS) {
     DispatchWorkItem(qos: .background, flags: .enforceQoS) {
         loggerLock.perform {
         loggerLock.perform {
-            category.logger.info(message, type: type, file: file, function: function, line: line)
-        }
-    }.perform()
-}
-
-func info(
-    _ category: Logger.Category,
-    _ message: String,
-    notificationText: String,
-    type: MessageType = .info,
-    file: String = #file,
-    function: String = #function,
-    line: UInt = #line
-) {
-    DispatchWorkItem(qos: .background, flags: .enforceQoS) {
-        loggerLock.perform {
-            category.logger.info(
-                message,
-                notificationText: notificationText,
-                type: type,
-                file: file,
-                function: function,
-                line: line
-            )
+            category.logger.info(message, file: file, function: function, line: line)
         }
         }
     }.perform()
     }.perform()
 }
 }
@@ -268,18 +243,6 @@ final class Logger {
 
 
     func info(
     func info(
         _ message: String,
         _ message: String,
-        type: MessageType = .info,
-        file: String = #file,
-        function: String = #function,
-        line: UInt = #line
-    ) {
-        info(message, notificationText: message, type: type, file: file, function: function, line: line)
-    }
-
-    func info(
-        _ message: String,
-        notificationText: String,
-        type: MessageType = .info,
         file: String = #file,
         file: String = #file,
         function: String = #function,
         function: String = #function,
         line: UInt = #line
         line: UInt = #line
@@ -287,8 +250,6 @@ final class Logger {
         let printedMessage = "INFO: \(message)"
         let printedMessage = "INFO: \(message)"
         os_log("%@ - %@ - %d %{public}@", log: log, type: .info, file.file, function, line, printedMessage)
         os_log("%@ - %@ - %d %{public}@", log: log, type: .info, file.file, function, line, printedMessage)
         reporter.log(category.name, printedMessage, file: file, function: function, line: line)
         reporter.log(category.name, printedMessage, file: file, function: function, line: line)
-
-        showAlert(notificationText, type: type)
     }
     }
 
 
     func warning(
     func warning(
@@ -324,13 +285,6 @@ final class Logger {
         )
         )
     }
     }
 
 
-    private func showAlert(_ message: String, type: MessageType = .info) {
-        DispatchQueue.main.async {
-            let messageCont = MessageContent(content: message, type: type)
-            router.alertMessage.send(messageCont)
-        }
-    }
-
     fileprivate func errorWithoutFatalError(
     fileprivate func errorWithoutFatalError(
         _ message: String,
         _ message: String,
         description: String? = nil,
         description: String? = nil,