We're using Crashlytics in our app for crash reporting and general logging tool.
Naturally, to avoid importing Firebase into every part of our app, we wrap the logging functionality in a Logger interface, and inject Firebase at the top level.
public protocol Logger {
func log(error: Error)
}
final class LoggerImpl: Logger {
func log(error: Error) {
Crashlytics.crashlytics().record(error: error)
}
}
Frustratingly, this means every non-fatal we log implicates the top-level app module, and the LoggerImpl file.
We need to drill down into the error's stack trace (Crashlytics uses NSThread callStackReturnAddresses internally) to find the culprit.
Is there any way to override behaviour on Crashlytics so this extremely common dependency-injection pattern can work better?
Looking through the Crashlytics API itself, the only method which seems plausible is recordError(error: userInfo:), however I was unable to find any documentation or work out any combination of keys and values which overrode the basic library/file in the UI.
If anyone has any thoughts, please let me know! I've also created a feature request in the Firebase Github page.

