I've enabled crashlytics and trying to log with following code. I'm getting this warning. Can't figure out what this warning is and how to fix it.
In other words how do I log using CLSNSLogv?
Crashlytics:Crash] WARNING: CLSLog has been used before (or concurrently with) Crashlytics initialization and cannot be recorded. The message was:
CLSNSLogv("load() %@ %d", getVaList(["Array count:", self.array.count]))
I'm the person that wrote that error message in the Crashlytics SDK :) However, I no longer work with that group and it's been a long time since I worked on that project. So, your best bet is to reach out to their support people.
Unless things have changed internally, the error message is telling you exactly what's up. Your use of CLSLog isn't the issue. The problem is the timing of its invocation. You cannot use the CLSLog family of functions until after the Crashlytics SDK has been fully initialized. It initializes synchronously. So, you can safely use CLSLog on the very next line after the Crashlytics SDK initialization call.
Perhaps you are invoking CLSLog in a function that's called asynchronously during startup?
Or, maybe you are initializing Crashlytics on a background thread? There are situations that cannot be reliably handled if you init the SDK asynchronously. I wouldn't recommend it, personally, but that's a call you have to make. I just want to make sure you understand the performance/correctness tradeoffs.