Skip to content

Commit

Permalink
v13.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Feb 1, 2024
1 parent e247116 commit 3820557
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion Example/Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, GleapDelegate {

//Gleap.setApiUrl("http://0.0.0.0:9000")
//Gleap.setFrameUrl("http://0.0.0.0:3001/appnew.html")
Gleap.initialize(withToken: "vcxExo94dQQv7KIXd1BnMgN2bzpwZnoj")
Gleap.initialize(withToken: "ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV")

Gleap.sharedInstance().delegate = self

Expand Down
2 changes: 1 addition & 1 deletion Gleap.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "Gleap"
s.version = "13.2.0"
s.version = "13.2.1"
s.summary = "In-App Bug Reporting and Testing for Apps. Learn more at https://gleap.io"
s.homepage = "https://gleap.io"
s.license = { :type => 'Commercial', :file => 'LICENSE.md' }
Expand Down
50 changes: 26 additions & 24 deletions Sources/ObjCSources/GleapConsoleLogHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,34 +107,36 @@ - (void)openConsoleLog {
*/
- (void)receiveLogNotification:(NSNotification *) notification
{
[_inputPipe.fileHandleForReading readInBackgroundAndNotify];
NSData *data = notification.userInfo[NSFileHandleNotificationDataItem];

// Write data to output pipe
if (_outputPipe != nil) {
[[_outputPipe fileHandleForWriting] writeData: data];
}

// Don't process the logs when the widget is opened.
if ([[GleapWidgetManager sharedInstance] isOpened]) {
return;
}

NSString *consoleLogLines = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
if (consoleLogLines != NULL) {
@try {
[_inputPipe.fileHandleForReading readInBackgroundAndNotify];
NSData *data = notification.userInfo[NSFileHandleNotificationDataItem];

NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\d+-\\d+-\\d+ \\d+:\\d+:\\d+.\\d+\\+\\d+ .+\\[.+:.+\\] " options:NSRegularExpressionCaseInsensitive error:&error];
consoleLogLines = [regex stringByReplacingMatchesInString: consoleLogLines options: 0 range:NSMakeRange(0, [consoleLogLines length]) withTemplate:@"#BBNL#"];
// Write data to output pipe
if (_outputPipe != nil) {
[[_outputPipe fileHandleForWriting] writeData: data];
}

NSArray *lines = [consoleLogLines componentsSeparatedByString: @"#BBNL#"];
for (int i = 0; i < lines.count; i++) {
NSString *line = [lines objectAtIndex: i];
if (line != NULL && ![line isEqualToString: @""]) {
[self addLogWith: line andPriority: @"INFO"];
// Don't process the logs when the widget is opened.
if ([[GleapWidgetManager sharedInstance] isOpened]) {
return;
}

NSString *consoleLogLines = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding];
if (consoleLogLines != NULL) {

NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\d+-\\d+-\\d+ \\d+:\\d+:\\d+.\\d+\\+\\d+ .+\\[.+:.+\\] " options:NSRegularExpressionCaseInsensitive error:&error];
consoleLogLines = [regex stringByReplacingMatchesInString: consoleLogLines options: 0 range:NSMakeRange(0, [consoleLogLines length]) withTemplate:@"#BBNL#"];

NSArray *lines = [consoleLogLines componentsSeparatedByString: @"#BBNL#"];
for (int i = 0; i < lines.count; i++) {
NSString *line = [lines objectAtIndex: i];
if (line != NULL && ![line isEqualToString: @""]) {
[self addLogWith: line andPriority: @"INFO"];
}
}
}
}
} @catch (id exp) {}
}

@end

0 comments on commit 3820557

Please sign in to comment.