Skip to content

Commit 400b5f7

Browse files
committed
Restore Crashlytics.
Former-commit-id: e91c1b5
1 parent 3f9eb93 commit 400b5f7

File tree

18 files changed

+695
-1
lines changed

18 files changed

+695
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
320440024c4c6cfc6e2ba4f7efe9ceea46bbab0f
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//
2+
// CLSLogging.h
3+
// Crashlytics
4+
//
5+
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
6+
//
7+
8+
#import <Fabric/FABAttributes.h>
9+
#ifdef __OBJC__
10+
#import <Foundation/Foundation.h>
11+
#endif
12+
13+
FAB_START_NONNULL
14+
15+
/**
16+
*
17+
* The CLS_LOG macro provides as easy way to gather more information in your log messages that are
18+
* sent with your crash data. CLS_LOG prepends your custom log message with the function name and
19+
* line number where the macro was used. If your app was built with the DEBUG preprocessor macro
20+
* defined CLS_LOG uses the CLSNSLog function which forwards your log message to NSLog and CLSLog.
21+
* If the DEBUG preprocessor macro is not defined CLS_LOG uses CLSLog only.
22+
*
23+
* Example output:
24+
* -[AppDelegate login:] line 134 $ login start
25+
*
26+
* If you would like to change this macro, create a new header file, unset our define and then define
27+
* your own version. Make sure this new header file is imported after the Crashlytics header file.
28+
*
29+
* #undef CLS_LOG
30+
* #define CLS_LOG(__FORMAT__, ...) CLSNSLog...
31+
*
32+
**/
33+
#ifdef __OBJC__
34+
#ifdef DEBUG
35+
#define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
36+
#else
37+
#define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
38+
#endif
39+
#endif
40+
41+
/**
42+
*
43+
* Add logging that will be sent with your crash data. This logging will not show up in the system.log
44+
* and will only be visible in your Crashlytics dashboard.
45+
*
46+
**/
47+
48+
#ifdef __OBJC__
49+
OBJC_EXTERN void CLSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
50+
OBJC_EXTERN void CLSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0);
51+
52+
/**
53+
*
54+
* Add logging that will be sent with your crash data. This logging will show up in the system.log
55+
* and your Crashlytics dashboard. It is not recommended for Release builds.
56+
*
57+
**/
58+
OBJC_EXTERN void CLSNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
59+
OBJC_EXTERN void CLSNSLogv(NSString *format, va_list ap) NS_FORMAT_FUNCTION(1,0);
60+
#endif
61+
62+
FAB_END_NONNULL
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
//
2+
// CLSReport.h
3+
// Crashlytics
4+
//
5+
// Copyright (c) 2015 Crashlytics, Inc. All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
#import <Fabric/FABAttributes.h>
10+
11+
FAB_START_NONNULL
12+
13+
/**
14+
* The CLSCrashReport protocol is deprecated. See the CLSReport class and the CrashyticsDelegate changes for details.
15+
**/
16+
@protocol CLSCrashReport <NSObject>
17+
18+
@property (nonatomic, copy, readonly) NSString *identifier;
19+
@property (nonatomic, copy, readonly) NSDictionary *customKeys;
20+
@property (nonatomic, copy, readonly) NSString *bundleVersion;
21+
@property (nonatomic, copy, readonly) NSString *bundleShortVersionString;
22+
@property (nonatomic, copy, readonly) NSDate *crashedOnDate;
23+
@property (nonatomic, copy, readonly) NSString *OSVersion;
24+
@property (nonatomic, copy, readonly) NSString *OSBuildVersion;
25+
26+
@end
27+
28+
/**
29+
* The CLSReport exposes an interface to the phsyical report that Crashlytics has created. You can
30+
* use this class to get information about the event, and can also set some values after the
31+
* event has occured.
32+
**/
33+
@interface CLSReport : NSObject <CLSCrashReport>
34+
35+
- (instancetype)init NS_UNAVAILABLE;
36+
37+
/**
38+
* Returns the session identifier for the report.
39+
**/
40+
@property (nonatomic, copy, readonly) NSString *identifier;
41+
42+
/**
43+
* Returns the custom key value data for the report.
44+
**/
45+
@property (nonatomic, copy, readonly) NSDictionary *customKeys;
46+
47+
/**
48+
* Returns the CFBundleVersion of the application that generated the report.
49+
**/
50+
@property (nonatomic, copy, readonly) NSString *bundleVersion;
51+
52+
/**
53+
* Returns the CFBundleShortVersionString of the application that generated the report.
54+
**/
55+
@property (nonatomic, copy, readonly) NSString *bundleShortVersionString;
56+
57+
/**
58+
* Returns the date that the report was created.
59+
**/
60+
@property (nonatomic, copy, readonly) NSDate *dateCreated;
61+
62+
/**
63+
* Returns the os version that the application crashed on.
64+
**/
65+
@property (nonatomic, copy, readonly) NSString *OSVersion;
66+
67+
/**
68+
* Returns the os build version that the application crashed on.
69+
**/
70+
@property (nonatomic, copy, readonly) NSString *OSBuildVersion;
71+
72+
/**
73+
* Returns YES if the report contains any crash information. If the report
74+
* contains only NSErrors, this will return NO.
75+
**/
76+
@property (nonatomic, assign, readonly) BOOL isCrash;
77+
78+
/**
79+
* You can use this method to set, after the event, additional custom keys. The rules
80+
* and semantics for this method are the same as those documented in Crashlytics.h. Be aware
81+
* that the maximum size and count of custom keys is still enforced, and you can overwrite keys
82+
* and/or cause excess keys to be deleted by using this method.
83+
**/
84+
- (void)setObjectValue:(id FAB_NULLABLE)value forKey:(NSString *)key;
85+
86+
/**
87+
* Record an application-specific user identifier. See Crashlytics.h for details.
88+
**/
89+
@property (nonatomic, copy) NSString * FAB_NULLABLE userIdentifier;
90+
91+
/**
92+
* Record a user name. See Crashlytics.h for details.
93+
**/
94+
@property (nonatomic, copy) NSString * FAB_NULLABLE userName;
95+
96+
/**
97+
* Record a user email. See Crashlytics.h for details.
98+
**/
99+
@property (nonatomic, copy) NSString * FAB_NULLABLE userEmail;
100+
101+
@end
102+
103+
FAB_END_NONNULL
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// CLSStackFrame.h
3+
// Crashlytics
4+
//
5+
// Copyright 2015 Crashlytics, Inc. All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
#import <Fabric/FABAttributes.h>
10+
11+
FAB_START_NONNULL
12+
13+
/**
14+
*
15+
* This class is used in conjunction with -[Crashlytics recordCustomExceptionName:reason:frameArray:] to
16+
* record information about non-ObjC/C++ exceptions. All information included here will be displayed
17+
* in the Crashlytics UI, and can influence crash grouping. Be particularly careful with the use of the
18+
* address property. If set, Crashlytics will attempt symbolication and could overwrite other properities
19+
* in the process.
20+
*
21+
**/
22+
@interface CLSStackFrame : NSObject
23+
24+
+ (instancetype)stackFrame;
25+
+ (instancetype)stackFrameWithAddress:(NSUInteger)address;
26+
+ (instancetype)stackFrameWithSymbol:(NSString *)symbol;
27+
28+
@property (nonatomic, copy) NSString * FAB_NULLABLE symbol;
29+
@property (nonatomic, copy) NSString * FAB_NULLABLE library;
30+
@property (nonatomic, copy) NSString * FAB_NULLABLE fileName;
31+
@property (nonatomic, assign) uint32_t lineNumber;
32+
@property (nonatomic, assign) uint64_t offset;
33+
@property (nonatomic, assign) uint64_t address;
34+
35+
@end
36+
37+
FAB_END_NONNULL

0 commit comments

Comments
 (0)