I combined SwiftyBeaver with Crashlytics to log all errors to Crashlytics.
For this I created this SwiftyBeaver BaseDestination:
public class CrashlyticsDestination: BaseDestination {
override public func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, file: String, function: String, line: Int, context: Any? = nil) -> String? {
guard level == .error else {return nil}
let formattedString = super.send(level, msg: msg, thread: thread, file: file, function: function, line: line)
if let str = formattedString {
CLSLogv(str, getVaList([str]))
}
return formattedString
}
}
CLSLogv is getting called but I do not see anything in Crashlytics or a error message in console. But if I force a crash I can see this crash there.
Any idea what could be wrong?