Privacy and console logs
Bugsee automatically captures all standard applications console logs. The feature can be either completely disabled or logs can be sanitized during recording to strip any PII data.
Disabling log collection
Console log collection can be disabled completely using BugseeCaptureLogsKey launch option. See configuration for more info.
Sanitizing logs
Your class should implement BugseeDelegate protocol and it must set itself as the delegate for Bugsee.
!Objective-C
-(void)bugseeFilterLog:(BugseeLogEvent *)log completionHandler:(BugseeLogFilterDecisionBlock)decisionBlock
{
// Below is an example code that will remove access_token from all URLs going through the filter.
NSError * error;
NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:@"access_token=[0-9a-z\\-]*"
options:NSRegularExpressionCaseInsensitive error:&error];
log.text = [regex stringByReplacingMatchesInString:log.text
options:0
range:NSMakeRange(0, log.text.length)
withTemplate:@"TokenWasFound here"];
decisionBlock(log);
}
// ..somewhere within the class
[Bugsee sharedInstance].delegate = self;
!Swift
private func bugseeFilterLog(log: BugseeLogEvent, completionHandler decisionBlock: @escaping BugseeLogFilterDecisionBlock) {
let regex : NSRegularExpression
do {
regex = try NSRegularExpression.init(pattern: "&access_token=[0-9a-z\\-]*",
options: NSRegularExpression.Options.caseInsensitive)
let range = NSMakeRange(0 , log.text.count)
log.text = regex.stringByReplacingMatches(in: log.text, options: .reportProgress, range: range, withTemplate: "")
}catch { print("Somethings went wrong!") }
decisionBlock(log);
}
// ..somewhere within the class
Bugsee.sharedInstance()?.delegate = self;
More about console logs - Logging