Install Bugfender normally using the instructions from the website. Then add to your SwiftyBeaver instance with:
let bugfender = BugfenderDestination()
log.addDestination(bugfender)
// | |
// BugfenderDestination.swift | |
// Bugfender | |
// | |
// Copyright by Bugfender Team | |
import Foundation | |
import SwiftyBeaver | |
public class BugfenderDestination: BaseDestination { | |
override public var defaultHashValue: Int { return 100 } | |
override public func send(_ level: SwiftyBeaver.Level, msg: String, thread: String, | |
file: String, function: String, line: Int) -> String? { | |
var bfLogLevel: BFLogLevel { | |
switch(level) { | |
case .error: | |
return BFLogLevel.error | |
case .warning: | |
return BFLogLevel.warning | |
default: | |
return BFLogLevel.default | |
} | |
} | |
Bugfender.logLineNumber(line, method: function, file: file, level: bfLogLevel, tag: thread, message: msg) | |
return super.send(level, msg: msg, thread: thread, file: file, function: function, line: line) | |
} | |
} |