All Projects β†’ CleanCocoa β†’ Crashreporter

CleanCocoa / Crashreporter

Licence: mit
Lightweight macOS Crash Reporter Setup

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Crashreporter

Xcrash
πŸ”₯ xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.
Stars: ✭ 2,689 (+2589%)
Mutual labels:  reporting, crash
Xcrash
πŸ”₯ xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.
Stars: ✭ 148 (+48%)
Mutual labels:  reporting, crash
Gowitness
πŸ” gowitness - a golang, web screenshot utility using Chrome Headless
Stars: ✭ 996 (+896%)
Mutual labels:  reporting
Simplewpfreporting
Reporting in WPF (XAML) made easy
Stars: ✭ 87 (-13%)
Mutual labels:  reporting
Ara
ARA Records Ansible and makes it easier to understand and troubleshoot.
Stars: ✭ 1,176 (+1076%)
Mutual labels:  reporting
Openvasreporting
OpenVAS Reporting: Convert OpenVAS XML report files to reports
Stars: ✭ 42 (-58%)
Mutual labels:  reporting
Jjexception
Protect the objective-c application(保技App不ι—ͺι€€)
Stars: ✭ 1,216 (+1116%)
Mutual labels:  crash
Crashanalyse
iOS crash log analyse,One click to complete.
Stars: ✭ 34 (-66%)
Mutual labels:  crash
Jest Allure
Generate Allure Report for jest. Allure Report, a flexible lightweight multi-language test report tool with the possibility to add steps, attachments, parameters and so on.
Stars: ✭ 90 (-10%)
Mutual labels:  reporting
Jmeter Elasticsearch Backend Listener
JMeter plugin that lets you send sample results to an ElasticSearch engine to enable live monitoring of load tests.
Stars: ✭ 72 (-28%)
Mutual labels:  reporting
Csgo Crash Exploit
Allows you to crash any Windows user
Stars: ✭ 87 (-13%)
Mutual labels:  crash
Publish Unit Test Result Action
GitHub Action to publish unit test results on GitHub
Stars: ✭ 71 (-29%)
Mutual labels:  reporting
Sentry React Native
Official Sentry SDK for react-native
Stars: ✭ 1,032 (+932%)
Mutual labels:  crash
Sentinl
Kibana Alert & Report App for Elasticsearch
Stars: ✭ 1,233 (+1133%)
Mutual labels:  reporting
Lldebugtoolswift
LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations.
Stars: ✭ 40 (-60%)
Mutual labels:  crash
Reportgenerator
ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
Stars: ✭ 1,276 (+1176%)
Mutual labels:  reporting
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (+890%)
Mutual labels:  crash
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (-31%)
Mutual labels:  crash
Pyreportjasper
Python Reporting with JasperReports
Stars: ✭ 77 (-23%)
Mutual labels:  reporting
Pyreportcard
πŸš₯ A report card for Python application
Stars: ✭ 90 (-10%)
Mutual labels:  reporting

CrashReporter for macOS Apps

CI Status Swift 5.0 Version License Platform Carthage compatible

Your app will crash one day. Be prepared to collect crash data automatically, because not every user is a techno wizard capable of sending you .crash files from the built-in Console app.

Requirements

  • macOS 10.12+
  • Xcode 10.2+
  • Swift 5+

For the optional server endpoint script, you'll need PHP 7.x.

Installation

Carthage

github "CleanCocoa/CrashReporter"

CocoaPods

pod 'CrashReporterMac'

SwiftPM

.package(url: "https://github.com/CleanCocoa/CrashReporter", from: "0.2.0")

Manual

If you want to customize the UI, checkout the source and copy all code from CrashReporter/ into your project.

Usage

Server Endpoint

You need a server endpoint to receive crash reports.

The framework does not care what the server does:

  • You can email the incoming crash report from your server, or
  • you can store the crash report as a timestamped file on disk for later reference, of
  • you can store the crash report in a database.

The crash reporter framework will perform a HTTP POST request:

  • The User-Agent metadata is set to "\(APP_NAME)-\(VERSION)" if the values are found in the app's bundle, e.g. "Sherlock-2.0".
  • The userEmail variable is either left out or set to the email entered by the user.
  • The crashlog variable is set to the contents of the .crash file the user submits.
  • The server response will be ignored.

You can roll your own endpoint as long as its URL is reachable from the app.

Or you can use the simple endpoint shipped in this repository! It's located at php/index.php. This PHP server script will attempt to email you the crash log as an attachment with a timestamp, e.g. 20190701204853 Sherlock-2.0.crash (where the timestamp signifies the ISO-formatted date 2019-07-01 20:48:52). If the user enters her email address, she'll receive a copy as CC by default. You can toggle this in the PHP script's frontmatter.

To run the script on your local machine for quick testing, run:

$ php -S 127.0.0.1:3333 php/index.php

Then use URL(string: "http://127.0.0.1:3333/") in your Swift code for the endpoint.

Application Setup

See the code in Example/, which is part of the Xcode project.

You can use the framework as-is in your app to check for crash reports:

import CrashReporter

let crashReporterURL = URL(string: "http://127.0.0.1:3333/")!
let crashReporter = CrashReporter(
    crashReporterURL: crashReporterURL,
    privacyPolicyURL: URL(string: "https://example.com/privacy-policy")!)

// Run the check in the background and display 
// a crash reporter window if needed
crashReporter.check()

Preference Pane in Your Application

If you allow the user to tick "Send crash reports automatically" in the crash reporter window, you should add a similar option to your app's preference pane to enable undoing this setting.

Refer to DefaultsKeys.sendCrashLogsAutomaticallyKey.

If you want to employ Cocoa Bindings to configure a "Send crash reports automatically" checkbox in your preference panes or main menu, then you can create a simple KVC-compliant wrapper in your classes:

// Assuming this is loaded from a Nib where you set an object of this type as the
// target for "Value" Cocoa Bindings.
class PreferenceController: NSViewController {
    let crashReporter: CrashReporter = // ... setup before ...
    
    // Cocoa bindings path is `self.sendCrashReportsAutomatically`
    @objc public dynamic var sendCrashReportsAutomatically: Bool {
        get {
            return crashReporter.sendCrashReportsAutomatically
        }
        set {
            crashReporter.sendCrashReportsAutomatically = newValue
        }
    }
}

API

  • CrashReporter.check() is the default call that displays the crash reporter window for the current app if needed, and uploads the crash report to the server.
  • CrashReporter.check(appName:collectEmailAddress:alwaysShowCrashReporterWindow:) allows you to control the app name for which the reporter searches .crash files. Set collectEmailAddress to false if you don't want to collect the email address of the user to get back to them. Set alwaysShowCrashReporterWindow to true if you always want to show the crash reporter window instead of letting the user pick when she sees the window.
  • CrashReporter.sendCrashReportsAutomatically exposes the user setting of sending reports automatically. Useful for preference panes.

If you don't change the UserDefaults keys for the crash reporter settings, use the various DefaultsKeys.standard properties in your app to look up the values:

  • emailAddressKey is "CRR_emailAddress", where the email address of the user is stored
  • sendCrashLogsAutomaticallyKey is "CRR_sendCrashLogsAutomatically" -- use this for your preference panes to toggle automatically sending crash reports
  • lastSeenCrashLogTimeSince1970Key is "CRR_lastSeenCrashLogTimeSince1970"
  • lastSeenCrashLogMD5Key is "CRR_lastSeenCrashLogMD5"

License

The whole project is distributed under the MIT license. See the LICENSE file for reference.

A quick overview:

  • The Swift code is adapted from Brent Simmons's NetNewsWire 5, Copyright Β© Brent Simmons 2017-2019. All rights reserved.
  • Changes in this repository are Copyright Β© Christian Tietze 2019. All rights reserved.
  • The PHP server code is Copyright Β© Christian Tietze 2019. All rights reserved.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].