Git Product home page Git Product logo

smobilog's Introduction

SMobiLog

SMobiLogger is a logger library, which provides logs, crash reports from iOS device along with email logs facility.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like 'SMobiLog' in your projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 0.39.0+ is required to build SMobiLog 0.1.0+.

Podfile

To integrate SMobiLog into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'SMobiLog'
end

Then, run the following command:

$ pod install

Requirements

SMobiLog Version Minimum iOS Target Notes
0.2.0 iOS 8 Get callback with crash report, if app crashed last time
0.1.5 iOS 8 Few bug fixes.
0.1.4 iOS 8 Integrated KSCrash reporting.
0.1.3 iOS 8 Handle Uncaught exceptions.
0.1.2 iOS 8 Xcode 8+ is required. Minimum iOS version support has been changed.
0.1.0 iOS 9.3 Realm support is included. Minimum iOS version support is 9.3

Usage

SMobiLogger

objective-c

In Appdelegate's didFinishLaunchingWithOptions: start MobiLogger

[[SMobiLogger sharedInterface] startMobiLogger]

It will clear old logs(currently it stores logs for 2 days, which can be changed from plist), initialise Realm

Log Uncaught exception

In Appdelegate's didFinishLaunchingWithOptions: call any one of the following method as per your need

- (KSCrashInstallation *)installKSCrashConsoleWithCompletionBlock:(smobiCompletionBlock)block;
- (KSCrashInstallation *)installKSCrashWithURLString:(NSString *)urlPath withCompletionBlock:(smobiCompletionBlock)block;
- (KSCrashInstallation *)installKSCrashWithEmails:(NSArray *)emails withCompletionBlock:(smobiCompletionBlock)block;
- (KSCrashInstallation *)installKSCrashConsoleWithAlert:(BOOL)showAlert withCompletionBlock:(smobiCompletionBlock)block;
- (KSCrashInstallation *)installKSCrashWithURLString:(NSString *)urlPath withAlert:(BOOL)showAlert withCompletionBlock:(smobiCompletionBlock)block;
- (KSCrashInstallation *)installKSCrashWithEmails:(NSArray *)emails withAlert:(BOOL)showAlert withCompletionBlock:(smobiCompletionBlock)block;

Log Types

Following types are available to differentiate log messages.

Debug,
Error,
Crash,
Information,
Warning,
Other

Log messages

Info Type:

[[SMobiLogger sharedInterface] info:@"Application Became Active ." withDescription:[NSString stringWithFormat:@"At: %s. \n  \n", __FUNCTION__]];

Error Type:

[[SMobiLogger sharedInterface] error:@"Network Status:" withDescription:@"Unavailable"];

You can use any logType as per your need.

Fetch logs

To Fetch all the logs from db

NSString *fetchLogString = [[SMobiLogger sharedInterface] fetchLogs];

Send logs via Email

To send logs via email (Pass your UIViewController on which you want to present MFMailComposeViewController)

- (void)sendEmailLogsWithRecipients:(NSArray *)recipients;

Credits

SMobiLog is owned and maintained by the Systango Ltd.

Security Disclosure

If you believe you have identified a security vulnerability with SMobiLog, you should report it as soon as possible via email to [email protected]. Also please post it to a issue tracker.

License

SMobiLog is released under the MIT license. See LICENSE for details.

smobilog's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.