uxcam / ios-sdk

This is the UXCam iOS SDK
9 stars 4 forks source link

Console is spewing "thread_policy_set(1) returned 46" #10

Closed joshavant closed 1 year ago

joshavant commented 2 years ago

I'm encountering an issue with this project where, after calling +[UXCam startWithConfiguration:], the console endlessly spews: thread_policy_set(1) returned 46

This entirely handicaps all console usage for projects which include this SDK. That is problematic, because a usable console is critical for development.

This issue has previously been reported by other UXCam users here, here, and here.

However, to date, all proposed solutions are insufficient: all involve either completely obliterating all console output, or handicapping console output but in a different way.

The only sufficient solution I've found so far is removing the UXCam SDK.

While this seems like an issue that may possibly even be Apple's responsibility, it remains that this is a critical issue affecting this project's end users. Like other issues of this nature, I would wonder if some refactoring would workaround the issue or, indeed, fix some unobviously improper configuration which is triggering this.

DFDIEGOH commented 2 years ago

HI @joshavant

To disable this message, they need to add below code to the AppDelegate application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)method.

 let fd = open("/dev/null", O_RDWR)
        let success = dup2(fd, STDERR_FILENO) >= 0
        assert(success)

Can you please try this and check if this warnings are suppress after adding this?

joshavant commented 2 years ago

This suppresses other useful output, unrelated to UXCam (for example, everything printed to console by NSLog()).

The solution is for the UXCam SDK to simply stop causing this to be emitted.