forked from twobitlabs/AnalyticsKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalyticsKit.h
66 lines (53 loc) · 2.26 KB
/
AnalyticsKit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// AnalyticsKit.h
// AnalyticsKit
//
// Created by Christopher Pickslay on 9/8/11.
// Copyright (c) 2011 Two Bit Labs. All rights reserved.
//
#import <Foundation/Foundation.h>
#pragma mark -
#pragma mark Macros - Logging
#define AKLOG(fmt, ...) NSLog(@"%s:%d (%s): " fmt, __FILE__, __LINE__, __func__, ## __VA_ARGS__)
#ifdef DEBUG
#define AKINFO(fmt, ...) AKLOG(fmt, ## __VA_ARGS__)
#else
// do nothing
#define AKINFO(fmt, ...)
#endif
#define AKERROR(fmt, ...) AKLOG(fmt, ## __VA_ARGS__)
@protocol AnalyticsKitProvider <NSObject>
// Lifecycle
-(void)applicationWillEnterForeground;
-(void)applicationDidEnterBackground;
-(void)applicationWillTerminate;
-(void)uncaughtException:(NSException *)exception;
//Logging events
-(void)logScreen:(NSString *)screenName;
-(void)logEvent:(NSString *)event;
-(void)logEvent:(NSString *)event withProperty:(NSString *)key andValue:(NSString *)value;
-(void)logEvent:(NSString *)event withProperties:(NSDictionary *)dict;
-(void)logEvent:(NSString *)event timed:(BOOL)timed;
-(void)logEvent:(NSString *)event withProperties:(NSDictionary *)dict timed:(BOOL)timed;
-(void)endTimedEvent:(NSString *)event withProperties:(NSDictionary *)dict;
-(void)logError:(NSString *)name message:(NSString *)message exception:(NSException *)exception;
-(void)logError:(NSString *)name message:(NSString *)message error:(NSError *)error;
@end
@interface AnalyticsKit : NSObject
+(void)initialize;
+(void)initializeLoggers:(NSArray *)loggers;
+(NSArray *)loggers;
+(void)applicationWillEnterForeground;
+(void)applicationDidEnterBackground;
+(void)applicationWillTerminate;
+(void)uncaughtException:(NSException *)exception;
+(void)logScreen:(NSString *)screenName;
+(void)logEvent:(NSString *)event;
+(void)logEvent:(NSString *)event withProperty:(NSString *)key andValue:(NSString *)value;
+(void)logEvent:(NSString *)event withProperties:(NSDictionary *)dict;
+(void)logEvent:(NSString *)event timed:(BOOL)timed;
+(void)logEvent:(NSString *)event withProperties:(NSDictionary *)dict timed:(BOOL)timed;
+(void)endTimedEvent:(NSString *)event withProperties:(NSDictionary *)dict;
+(void)logError:(NSString *)name message:(NSString *)message exception:(NSException *)exception;
+(void)logError:(NSString *)name message:(NSString *)message error:(NSError *)error;
@end