Skip to content

Commit

Permalink
Merge pull request #25 from WideSpectrumComputing/master
Browse files Browse the repository at this point in the history
Implemented new RollbarPLCrashReporter module
  • Loading branch information
akornich authored Dec 31, 2020
2 parents e9d3f0b + 380f172 commit d064c01
Show file tree
Hide file tree
Showing 28 changed files with 468 additions and 25 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co
## Release Notes

**2.0.0** Preliminary Notes
- feat: added RollbarKSCrash
- feat: added RollbarPLCrashReporter module
- feat: added RollbarKSCrash module
- feat: explicit reporting of NSErrors
- feat: defined default scrub fields
- refactor: split out RollbarCommon, RollbarNotifier, RollbarDeploys
- refactor: added use of lightweight generics
- refactor: added use nullability attributes
Expand All @@ -35,5 +38,3 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co
- refactor: removed all the deprecated API
- refactor: replace NSString-like log level parameters in RollbarLogger interface with RollbarLevel enum
- refactor: replace sync-all log methods of Rollbar and RolbarLogger with ones dedicated to each type of payload: string-message, NSException, NSError, etc.
- feat: defined default scrub fields
- feat: explicit reporting of NSErrors
7 changes: 7 additions & 0 deletions Demos/macosAppObjC/macosAppObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
55759A732477561100ED3F04 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 55759A722477561100ED3F04 /* Assets.xcassets */; };
55759A762477561100ED3F04 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 55759A742477561100ED3F04 /* Main.storyboard */; };
55759A792477561100ED3F04 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 55759A782477561100ED3F04 /* main.m */; };
55A02A60259AAAE40071D60D /* RollbarPLCrashReporter in Frameworks */ = {isa = PBXBuildFile; productRef = 55A02A5F259AAAE40071D60D /* RollbarPLCrashReporter */; };
55FD0711247860F1000BBC22 /* RollbarDeploys in Frameworks */ = {isa = PBXBuildFile; productRef = 55FD0710247860F1000BBC22 /* RollbarDeploys */; };
55FD07142478614B000BBC22 /* RollbarDeploysDemoClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 55FD07132478614B000BBC22 /* RollbarDeploysDemoClient.m */; };
/* End PBXBuildFile section */
Expand All @@ -38,6 +39,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
55A02A60259AAAE40071D60D /* RollbarPLCrashReporter in Frameworks */,
55684F5A2553981600F82F34 /* RollbarKSCrash in Frameworks */,
55FD0711247860F1000BBC22 /* RollbarDeploys in Frameworks */,
5547273924903EB7005018BD /* RollbarNotifier in Frameworks */,
Expand Down Expand Up @@ -109,6 +111,7 @@
55FD0710247860F1000BBC22 /* RollbarDeploys */,
5547273824903EB7005018BD /* RollbarNotifier */,
55684F592553981600F82F34 /* RollbarKSCrash */,
55A02A5F259AAAE40071D60D /* RollbarPLCrashReporter */,
);
productName = macosAppObjC;
productReference = 55759A692477560D00ED3F04 /* macosAppObjC.app */;
Expand Down Expand Up @@ -367,6 +370,10 @@
isa = XCSwiftPackageProductDependency;
productName = RollbarKSCrash;
};
55A02A5F259AAAE40071D60D /* RollbarPLCrashReporter */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarPLCrashReporter;
};
55FD0710247860F1000BBC22 /* RollbarDeploys */ = {
isa = XCSwiftPackageProductDependency;
productName = RollbarDeploys;
Expand Down
19 changes: 15 additions & 4 deletions Demos/macosAppObjC/macosAppObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
#import "RollbarDeploysDemoClient.h"

@import RollbarNotifier;
@import RollbarKSCrash;

//@import RollbarKSCrash;
@import RollbarPLCrashReporter;

__attribute__((noinline)) static void crashIt (void) {
/* Trigger a crash */
((char *)NULL)[1] = 0;
}

@interface AppDelegate ()

Expand All @@ -20,6 +27,7 @@ @interface AppDelegate ()
@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

// Insert code here to initialize your application
[self initRollbar];

Expand All @@ -36,7 +44,6 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
context:nil
];
}


@try {
[self callTroublemaker];
Expand All @@ -51,13 +58,15 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// @throw NSInternalInconsistencyException;
// [self performSelector:@selector(die_die)];
// [self performSelector:NSSelectorFromString(@"crashme:") withObject:nil afterDelay:10];
assert(NO);
//assert(NO);
//exit(0);
crashIt();

}


- (void)applicationWillTerminate:(NSNotification *)aNotification {

// Insert code here to tear down your application

[Rollbar infoMessage:@"The hosting application is terminating..."];
Expand All @@ -72,7 +81,9 @@ - (void)initRollbar {
config.destination.environment = @"samples";
config.customData = @{ @"someKey": @"someValue", };
// init Rollbar shared instance:
id<RollbarCrashCollector> crashCollector = [[RollbarKSCrashCollector alloc] init];
id<RollbarCrashCollector> crashCollector =
//[[RollbarKSCrashCollector alloc] init];
[[RollbarPLCrashCollector alloc] init];
[Rollbar initWithConfiguration:config crashCollector:crashCollector];

[Rollbar infoMessage:@"Rollbar is up and running! Enjoy your remote error and log monitoring..."];
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ All the active development will be done within this SDK repository.
[![Platform](https://img.shields.io/cocoapods/p/RollbarDeploys.svg?label=RollbarDeploys)](https://docs.rollbar.com/docs/apple)
[![Platform](https://img.shields.io/cocoapods/p/RollbarCommon.svg?label=RollbarCommon)](https://docs.rollbar.com/docs/apple)
[![Platform](https://img.shields.io/cocoapods/p/RollbarKSCrash.svg?label=RollbarKSCrash)](https://docs.rollbar.com/docs/apple)
[![Platform](https://img.shields.io/cocoapods/p/RollbarPLCrashReporter.svg?label=RollbarPLCrashReporter)](https://docs.rollbar.com/docs/apple)

[![CocoaPods](https://img.shields.io/cocoapods/v/RollbarNotifier?label=RollbarNotifier)](https://cocoapods.org/pods/RollbarNotifier)
[![CocoaPods](https://img.shields.io/cocoapods/v/RollbarDeploys?label=RollbarDeploys)](https://cocoapods.org/pods/RollbarDeploys)
[![CocoaPods](https://img.shields.io/cocoapods/v/RollbarCommon?label=RollbarCommon)](https://cocoapods.org/pods/RollbarCommon)
[![CocoaPods](https://img.shields.io/cocoapods/v/RollbarKSCrash?label=RollbarKSCrash)](https://cocoapods.org/pods/RollbarKSCrash)
[![CocoaPods](https://img.shields.io/cocoapods/v/RollbarPLCrashReporter?label=RollbarPLCrashReporter)](https://cocoapods.org/pods/RollbarPLCrashReporter)

## Setup Instructions

Expand Down
4 changes: 2 additions & 2 deletions RollbarCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha27"
s.version = "2.0.0-alpha28"
s.name = "RollbarCommon"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.summary = "Application or client side SDK for interacting with the Rollbar API Server."
s.description = <<-DESC
Find, fix, and resolve errors with Rollbar.
Easily send error data using Rollbar API.
Expand Down
2 changes: 1 addition & 1 deletion RollbarCommon/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RollbarCommon

This is an SDK module declaring protocols and implementing classes/types commonly used across the other SDK modules.
This is an SDK module declaring abstractions/concepts (protocols, abstract classes, etc.) and implementing classes/types commonly used across the other SDK modules.

If any data type is used by more than one SDK module - place it here.
4 changes: 2 additions & 2 deletions RollbarDeploys.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha27"
s.version = "2.0.0-alpha28"
s.name = "RollbarDeploys"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.summary = "Application or client side SDK for interacting with the Rollbar API Server."
s.description = <<-DESC
Find, fix, and resolve errors with Rollbar.
Easily send error data using Rollbar API.
Expand Down
4 changes: 2 additions & 2 deletions RollbarKSCrash.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha27"
s.version = "2.0.0-alpha28"
s.name = "RollbarKSCrash"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.summary = "Application or client side SDK for interacting with the Rollbar API Server."
s.description = <<-DESC
Find, fix, and resolve errors with Rollbar.
Easily send error data using Rollbar API.
Expand Down
3 changes: 2 additions & 1 deletion RollbarKSCrash/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# RollbarKSCrash

This is an SDK module implementing integration with [KSCrash reporter](https://github.com/kstenerud/KSCrash).
This is an SDK module implements a RollbarCrashCollector based on the [KSCrash reporter](https://github.com/kstenerud/KSCrash).

4 changes: 2 additions & 2 deletions RollbarNotifier.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

Pod::Spec.new do |s|

s.version = "2.0.0-alpha27"
s.version = "2.0.0-alpha28"
s.name = "RollbarNotifier"
s.summary = "Application or client side SDK for accessing the Rollbar API Server."
s.summary = "Application or client side SDK for interacting with the Rollbar API Server."
s.description = <<-DESC
Find, fix, and resolve errors with Rollbar.
Easily send error data using Rollbar API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#pragma mark - constants

static NSString * const NOTIFIER_VERSION = @"2.0.0-alpha27";
static NSString * const NOTIFIER_VERSION = @"2.0.0-alpha28";

static NSString * const NOTIFIER_NAME = @"rollbar-apple";

Expand Down
4 changes: 0 additions & 4 deletions RollbarNotifier/Sources/RollbarNotifier/RollbarLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "RollbarThread.h"
#import "RollbarReachability.h"
#import <sys/utsname.h>
//#import "KSCrash.h"
#import "RollbarTelemetry.h"
#import "RollbarPayloadTruncator.h"
#import "RollbarConfig.h"
Expand Down Expand Up @@ -54,9 +53,6 @@ - (void)_test_doNothing;

@end

//#define IS_IOS7_OR_HIGHER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
//#define IS_MACOS10_10_OR_HIGHER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_10)

@implementation RollbarLogger {
NSDate *nextSendTime;

Expand Down
64 changes: 64 additions & 0 deletions RollbarPLCrashReporter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Be sure to run `pod spec lint RollbarPLCrashReporter.podspec' to ensure this is a valid spec.
#
# To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |s|

s.version = "2.0.0-alpha28"
s.name = "RollbarPLCrashReporter"
s.summary = "Application or client side SDK for interacting with the Rollbar API Server."
s.description = <<-DESC
Find, fix, and resolve errors with Rollbar.
Easily send error data using Rollbar API.
Analyze, de-dupe, send alerts, and prepare the data for further analysis.
Search, sort, and prioritize via the Rollbar dashboard.
DESC
s.homepage = "https://rollbar.com"
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
s.license = { :type => "MIT", :file => "LICENSE" }
# s.license = "MIT (example)"
s.documentation_url = "https://docs.rollbar.com/docs/ios"
s.authors = { "Andrey Kornich (Wide Spectrum Computing LLC)" => "[email protected]",
"Rollbar" => "[email protected]" }
# s.author = { "Andrey Kornich" => "[email protected]" }
# Or just: s.author = "Andrey Kornich"
s.social_media_url = "http://twitter.com/rollbar"
s.source = { :git => "https://github.com/rollbar/rollbar-apple.git",
:tag => "v#{s.version}"
}
s.resource = "rollbar-logo.png"
# s.resources = "Resources/*.png"

# When using multiple platforms:
s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.10"
s.tvos.deployment_target = "11.0"
s.watchos.deployment_target = "4.0"
# Any platform, if omitted:
# s.platform = :ios
# s.platform = :ios, "5.0"

s.source_files = "#{s.name}/Sources/#{s.name}/**/*.{h,m}"
s.public_header_files = "#{s.name}/Sources/#{s.name}/include/*.h"
s.module_map = "#{s.name}/Sources/#{s.name}/include/module.modulemap"
# s.exclude_files = "Classes/Exclude"
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"

s.framework = "Foundation"
s.dependency "RollbarCommon", "~> #{s.version}"
s.dependency "PLCrashReporter", "~> 1.8.1"
# s.frameworks = "SomeFramework", "AnotherFramework"
# s.library = "iconv"
# s.libraries = "iconv", "xml2"
# s.dependency "JSONKit", "~> 1.4"

s.requires_arc = true
# s.xcconfig = {
# "USE_HEADERMAP" => "NO",
# "HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/Sources/#{s.name}/**"
# }

end
5 changes: 5 additions & 0 deletions RollbarPLCrashReporter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1230"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarPLCrashReporter"
BuildableName = "RollbarPLCrashReporter"
BlueprintName = "RollbarPLCrashReporter"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarPLCrashReporterTests"
BuildableName = "RollbarPLCrashReporterTests"
BlueprintName = "RollbarPLCrashReporterTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "RollbarPLCrashReporter"
BuildableName = "RollbarPLCrashReporter"
BlueprintName = "RollbarPLCrashReporter"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit d064c01

Please sign in to comment.