Last active
April 17, 2019 14:29
-
-
Save digitaljerry/f8205ea6305f8e5abf75b44b50e436f9 to your computer and use it in GitHub Desktop.
SwiftyBeaver destination used to log info warning and error traces using Crashlytics Raw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CrashlyticsDestination: BaseDestination { | |
open override func send(_ level: SwiftyBeaver.Level, msg traceMessage: String, thread traceThread: String, file traceFile: String, | |
function traceFunction: String, line traceLine: Int, context _: Any? = nil) -> String? { | |
if level.rawValue >= SwiftyBeaver.Level.info.rawValue { | |
let userInfo: [String: Any] = [ | |
"Level": level.rawValue, | |
"Msg": traceMessage, | |
"File": traceFile, | |
"Function": traceFunction, | |
"Line": traceLine | |
] | |
CLSLogv("%@", getVaList([userInfo])) | |
} | |
return super.send(level, msg: traceMessage, thread: traceThread, file: traceFile, function: traceFunction, line: traceLine) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment