braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: Excessive debug logs CDPurgeableResultCache #54

Closed JackTudor96 closed 1 year ago

JackTudor96 commented 1 year ago

Platform

iOS

Platform Version

iOS 16.3.1

Braze SDK Version

5.11.2

Xcode Version

Xcode 14.2

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Example:

  1. Complete initial Braze integration.
  2. Run the app.

Expected Behavior

Meaningful logs that we're able to use to work with our app. Is there a way we can filter them out or investigate if there's an issue?

Actual Incorrect Behavior

Logs are clogging up the debugger, so it's very difficult to know what's going on. This has started since integrating Braze on one of our feature branches using SPM.

Verbose Logs

[client] 114 CDPurgeableResultCache _recentPurgeableTotals no result for /private/var/MobileSoftwareUpdate, setting to zero
[client] 114 CDPurgeableResultCache _recentPurgeableTotals no result for /private/var/hardware, setting to zero
[client] 114 CDPurgeableResultCache _recentPurgeableTotals no result for /private/var/wireless/baseband_data, setting to zero

Additional Information

No response

jerielng commented 1 year ago

Hi @JackTudor96, you can control the logger level in Braze using the configuration.logger.level property before initializing the Braze instance with your configuration:

let configuration = Braze.Configuration(
  apiKey: "<BRAZE_API_KEY>",
  endpoint: "<BRAZE_ENDPOINT>"
)
configuration.logger.level = .info
let braze = Braze(configuration: configuration)

There's a .disabled level if you want to turn it off entirely.

However, those logs seem foreign to our SDK and may point to a separate issue. Could you provide a little more insight on where they're occurring? Is it at startup or throughout the entire runtime of your app? Are there also other libraries that are integrated on that feature branch?

JackTudor96 commented 1 year ago

Hey @jerielng thanks for the quick response! After some further investigation, I also agree that it's likely a different dependency we have. It was just coincidental I was testing on a physical device at the time and it wasn't showing up on simulator logs.

Thanks!