@@ -35,15 +35,9 @@ import Foundation
3535 if let _logger, _loggerConfigured {
3636 return _logger
3737 }
38- let hub = SentryDependencyContainerSwiftHelper . currentHub ( )
39- var batcher : SentryLogBatcher ?
40- if let client = hub. getClient ( ) , client. options. enableLogs {
41- batcher = SentryLogBatcher ( client: client, dispatchQueue: Dependencies . dispatchQueueWrapper)
42- }
4338 let logger = SentryLogger (
44- hub: hub,
45- dateProvider: Dependencies . dateProvider,
46- batcher: batcher
39+ hub: SentryDependencyContainerSwiftHelper . currentHub ( ) ,
40+ dateProvider: Dependencies . dateProvider
4741 )
4842 _logger = logger
4943 _loggerConfigured = sdkEnabled
@@ -360,18 +354,12 @@ import Foundation
360354 /// - note: This might take slightly longer than the specified timeout if there are many batched logs to capture.
361355 @objc ( flush: )
362356 public static func flush( timeout: TimeInterval ) {
363- let captureLogsDuration = captureLogs ( )
364- // Capturing batched logs should never take long, but we need to fall back to a sane value.
365- // This is a workaround for experimental logs, until we'll write batched logs to disk,
366- // to avoid data loss due to crashes. This is a trade-off until then.
367- SentrySDKInternal . flush ( timeout: max ( timeout / 2 , timeout - captureLogsDuration) )
357+ SentrySDKInternal . flush ( timeout: timeout)
368358 }
369359
370360 /// Closes the SDK, uninstalls all the integrations, and calls `flush` with
371361 /// `SentryOptions.shutdownTimeInterval`.
372362 @objc public static func close( ) {
373- // Capturing batched logs should never take long, ignore the duration here.
374- _ = captureLogs ( )
375363 SentrySDKInternal . close ( )
376364 }
377365
@@ -430,15 +418,6 @@ import Foundation
430418 private static var _logger : SentryLogger ?
431419 // Flag to re-create instance if accessed before SDK init.
432420 private static var _loggerConfigured = false
433-
434- @discardableResult
435- private static func captureLogs( ) -> TimeInterval {
436- var duration : TimeInterval = 0.0
437- _loggerLock. synchronized {
438- duration = _logger? . captureLogs ( ) ?? 0.0
439- }
440- return duration
441- }
442421}
443422
444423extension SentryIdWrapper {
0 commit comments