diff --git a/AppDebugMode-iOS-Sample/AppDebugMode-iOS-Sample/Application/AppDelegate.swift b/AppDebugMode-iOS-Sample/AppDebugMode-iOS-Sample/Application/AppDelegate.swift index e076934..136f7e2 100644 --- a/AppDebugMode-iOS-Sample/AppDebugMode-iOS-Sample/Application/AppDelegate.swift +++ b/AppDebugMode-iOS-Sample/AppDebugMode-iOS-Sample/Application/AppDelegate.swift @@ -48,7 +48,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { await PackageManager.shared.setup( serverProviders: providers, configurableProxySessionProvider: Container.shared.configurableSessionProvider.resolve(), - customControls: CustomControlsView(model: model) + customControls: CustomControlsView(model: model), + pulseLoggingEnabled: false ) } diff --git a/Sources/AppDebugMode/Dependencies/PackageManager.swift b/Sources/AppDebugMode/Dependencies/PackageManager.swift index 7d0b12b..7d906ce 100644 --- a/Sources/AppDebugMode/Dependencies/PackageManager.swift +++ b/Sources/AppDebugMode/Dependencies/PackageManager.swift @@ -47,6 +47,7 @@ public actor PackageManager { internal var customControlsViewIsVisible: Bool { !(customControls is EmptyView) } + internal var pulseLoggingEnabled: Bool = true // MARK: - State @@ -81,9 +82,13 @@ public extension PackageManager { serverProviders: [DebugSelectableServerProvider], configurableProxySessionProvider: ConfigurableSessionProvider?, firebaseMessaging: AnyObject? = nil, - customControls: (some View)? = nil + customControls: (some View)? = nil, + pulseLoggingEnabled: Bool = true ) async { - NetworkLogger.enableProxy() + self.pulseLoggingEnabled = pulseLoggingEnabled + if pulseLoggingEnabled { + NetworkLogger.enableProxy() + } if !serverProviders.isEmpty { Container.shared.setupServerProviders(providers: serverProviders) @@ -111,7 +116,8 @@ public extension PackageManager { func start() async -> UIViewController { let viewController = await AppDebugView( customControls: AnyView(customControls), - customControlsViewIsVisible: customControlsViewIsVisible + customControlsViewIsVisible: customControlsViewIsVisible, + pulseLoggingEnabled: pulseLoggingEnabled ) .eraseToUIViewController() diff --git a/Sources/AppDebugMode/Views/AppDebugView.swift b/Sources/AppDebugMode/Views/AppDebugView.swift index 81b08ec..b592f2e 100644 --- a/Sources/AppDebugMode/Views/AppDebugView.swift +++ b/Sources/AppDebugMode/Views/AppDebugView.swift @@ -47,7 +47,8 @@ struct AppDebugView: View { init( customControls: CustomControls, - customControlsViewIsVisible: Bool + customControlsViewIsVisible: Bool, + pulseLoggingEnabled: Bool ) { self.customControls = customControls self.customControlsViewIsVisible = customControlsViewIsVisible @@ -72,11 +73,13 @@ struct AppDebugView: View { )) } - self.screens.append(Screen( - title: "Pulse Logs", - image: Image(systemName: "wave.3.forward"), - destination: AnyView(PulseUI.ConsoleView().tint(AppDebugColors.primary)) - )) + if pulseLoggingEnabled { + self.screens.append(Screen( + title: "Pulse Logs", + image: Image(systemName: "wave.3.forward"), + destination: AnyView(PulseUI.ConsoleView().tint(AppDebugColors.primary)) + )) + } self.screens.append(contentsOf: [ Screen(