Skip to content

iosphere/ISHLogDNA

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

LogDNA for iOS

This micro-framework supports remote logging via LogDNA on iOS. The framework itself is written in ObjC for easy integration in Swift and ObjC apps.

Requires a deployment target of iOS 9 and above.

Sample

Objective-C

[ISHLogDNAService setupWithIngestionKey:ingestionKey
                               hostName:hostName
                                appName:appName];

// Send message including custom meta data (the dictionary must be encodable into JSON)
ISHLogDNAMessage *m;
m = [ISHLogDNAMessage messageWithLine:@"Sample app started"
                                level:ISHLogDNALevelInfo
                                 meta:@{@"anyKey" : @[@1, @42]}];
[ISHLogDNAService logMessages:@[m]];

Swift

ISHLogDNAService.setup(withIngestionKey: "", hostName: "", appName: "")

let message = ISHLogDNAMessage(line: "Sample app started", level: .info, meta: [ "myField" : 42 ])
ISHLogDNAService.logMessages([message]);

Usage

Simply include the following files in your project:

  • ISHLogDNAService.h
  • ISHLogDNAService.m

For Swift: ensure to include #import "ISHLogDNAService.h" in your bridging header.

ISHLogDNAService uses the AdSupport framework to use a sensible default for the enabled flag. By default logging is only enabled for users with isAdvertisingTrackingEnabled.

About

Remote logging for iOS via LogDNA with a simple Objective-C (Swift-compatible) wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published