I have a set of custom functions that's basically wrappers to logging and assertion behaviours. In particular there is an assert class function and a fatal class function. Both which generates a log and then proceed to assert() or fatal().
In my particular case, I have Crashlytics installed. So the generated log message will also go to CLSLogv(). The assert()/fatal() then generates a Crashlytics crash report. These all work fine.
My problem is in the Crashlytics dashboard, it basically just gives me my wrapper function/file/line information as my Issue Title and Description. In essence then every single assertion event, despite of differing causes/callers, will look the same on the Crashlytics Dashboard. Invoking Crashlytics.sharedSession().crash() instead of assert()/fatal() does not help either, as crash() does not allow any arguments for function/line/file.
Is there any other ways of doing this? Or is this essentially an enhancement request to Crashlytics/Fabric/Google? Thanks!
Swift allows you to use these special values:
#file
,#function
,#line
and#column
. Using them withCLSLogv()
may help you find the exact places your code went through:Result in Crashlytics dashboard:
Hope this helps :).