Privacy and console logs
Bugsee automatically captures all standard application 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 the BugseeDelegate protocol and it must set itself as the delegate for Bugsee.
- Objective-C
- Swift
-(void)bugseeFilterLog:(BugseeLogEvent *)log completionHandler:(BugseeLogFilterDecisionBlock)decisionBlock
{
// Below is an example that replaces the access_token value in all URLs
// going through the filter with a fixed placeholder.
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:@"access_token=<redacted>"];
decisionBlock(log);
}
// ..somewhere within the class
[Bugsee sharedInstance].delegate = self;
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: "access_token=<redacted>")
}catch { print("Somethings went wrong!") }
decisionBlock(log);
}
// ..somewhere within the class
Bugsee.sharedInstance()?.delegate = self;
More about console logs - Logging
Found an issue, typo, or wrong statement on this page? Report it now →