Skip to content

Commit

Permalink
moved some files back into place :: misc cleanup :: added some docume…
Browse files Browse the repository at this point in the history
…ntation for the crash reporter
  • Loading branch information
raycutler committed Jan 13, 2010
1 parent f4ca9dd commit d37a617
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions VVBasics/src/NamedMutLockArray.h
Expand Up @@ -21,6 +21,9 @@
NSString *name; NSString *name;
} }


+ (id) arrayWithCapacity:(int)c;
+ (id) create;

- (NSComparisonResult) nameCompare:(NamedMutLockArray *)comp; - (NSComparisonResult) nameCompare:(NamedMutLockArray *)comp;


@property (assign, readwrite) NSString *name; @property (assign, readwrite) NSString *name;
Expand Down
14 changes: 14 additions & 0 deletions VVBasics/src/NamedMutLockArray.m
Expand Up @@ -7,6 +7,20 @@
@implementation NamedMutLockArray @implementation NamedMutLockArray




+ (id) arrayWithCapacity:(int)c {
NamedMutLockArray *returnMe = [[NamedMutLockArray alloc] initWithCapacity:c];
if (returnMe == nil)
return nil;
return [returnMe autorelease];
}
+ (id) create {
NamedMutLockArray *returnMe = [[NamedMutLockArray alloc] initWithCapacity:0];
if (returnMe == nil)
return nil;
return [returnMe autorelease];
}


- (NSString *) description { - (NSString *) description {
return [NSString stringWithFormat:@"<NamedMutLockArray: %@, %@>",name,array]; return [NSString stringWithFormat:@"<NamedMutLockArray: %@, %@>",name,array];
} }
Expand Down
2 changes: 1 addition & 1 deletion VVBasics/src/VVCURLDL.h
Expand Up @@ -4,7 +4,7 @@
basic http transfer ops basic http transfer ops
basically, this class exists because at this time NSURLConnection is problematic and basically, this class exists because at this time NSURLConnection is problematic and
top-heavy, and i wanted a small, quick, and effective interface for handling the extremely top-heavy, and i wanted an easy, effective, and reliable interface for handling the extremely
limited set of http data transfer operations required by my frameworks/apps. limited set of http data transfer operations required by my frameworks/apps.
this class was meant to be used as a one-shot throwaway; that is, you're meant to create an this class was meant to be used as a one-shot throwaway; that is, you're meant to create an
Expand Down
52 changes: 25 additions & 27 deletions VVBasics/src/VVCrashReporter.h
@@ -1,30 +1,3 @@
/*
it's been my experience that most apps crash much more frequently on end-users than the app's
developers would guess. the simplest and easiest way to improve the end-user's experience is to
have the application check their machine for crash logs- which are generated automatically by os
x whenever an application crashes- and send them to the developer.
this class exists so i have a really easy way to make my apps send their crash logs to me; the
goal here is to make it as easy as possible to get all the information i need to troubleshoot a
problem with as little work on the user's part as possible. it also sends a basic system
profile, anything the app recently printed to the console log, and optional description/email
fields to facilitate communication directly with the user. this data is then uploaded to a
given URL using an HTTP POST.
on the server side, i use a PHP page which sanitizes the POST data (i can't stress how important
this step is) and works with it. i've included a sample PHP page that simply dumps the received
data to a file on disk (and optionally emails someone) with this project.
HOW TO USE THIS CLASS:
1)- create an instance of this class
2)- set the instance's delegate and uploadURL. these are necessary!
3)- call "check" on the instance. when it's done, it calls "crashReporterCheckDone" on the
delegate.
*/



#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <SystemConfiguration/SCNetwork.h> #import <SystemConfiguration/SCNetwork.h>
Expand All @@ -35,12 +8,33 @@






/// The crash reporter's delegate must adhere to this protocol
/*!
This protocol exists largely because it's conceivable that objects will want to know when the crash reporter- which uploads asynchronously- has finished sending its data to the remote server.
*/
@protocol VVCrashReporterDelegate @protocol VVCrashReporterDelegate
- (void) crashReporterCheckDone; - (void) crashReporterCheckDone;
@end @end






/// Simple class which automatically uploads crash logs and other relevant diagnostic information automatically made available by os x to a remote server.
/*!
it's been my experience that most apps crash much more frequently on end-users than the app's developers would guess. the simplest and easiest way to improve the end-user's experience is to have the application check their machine for crash logs- which are generated automatically by os x whenever an application crashes- and send them to the developer.
this class exists so i have a really easy way to make my apps send their crash logs to me; the goal here is to make it as easy as possible to get all the information i need to troubleshoot a problem with as little work on the user's part as possible. it also sends a basic system profile, anything the app recently printed to the console log, and optional description/email fields to facilitate communication directly with the user. this data is then uploaded to a given URL using an HTTP POST.
on the server side, i use a PHP page which sanitizes the POST data (i can't stress how important this step is) and works with it. i've included a sample PHP page that simply dumps the received data to a file on disk (and optionally emails someone) with this project.
HOW TO USE THIS CLASS:
1)- create an instance of this class
2)- set the instance's delegate, uploadURL, and developerEmail. these are necessary!
3)- call "check" on the instance. when it's done, it calls "crashReporterCheckDone" on the
delegate. that's it- you're done.
*/


@interface VVCrashReporter : NSObject <VVCURLDLDelegate> { @interface VVCrashReporter : NSObject <VVCURLDLDelegate> {
NSString *uploadURL; // does NOT includes http:// NSString *uploadURL; // does NOT includes http://
Expand All @@ -65,6 +59,7 @@
NSArray *nibTopLevelObjects; NSArray *nibTopLevelObjects;
} }


/// This is the main method- when you call 'check', the crash reporter looks for crash logs, gets a basic system profile, and collects anything your applications has dumped to the console log.
- (void) check; - (void) check;
- (void) openCrashReporter; - (void) openCrashReporter;
- (IBAction) doneClicked:(id)sender; - (IBAction) doneClicked:(id)sender;
Expand All @@ -81,11 +76,14 @@
// VVCURLDLDelegate method- this class will be the delegate of multiple VVCURLDL instances // VVCURLDLDelegate method- this class will be the delegate of multiple VVCURLDL instances
- (void) dlFinished:(id)h; - (void) dlFinished:(id)h;


/// Sets the developer email address; this is displayed if the user has a problem connecting to the internet/the server the crash reporter is supposed to be connecting to
- (void) setDeveloperEmail:(NSString *)n; - (void) setDeveloperEmail:(NSString *)n;
- (NSString *) developerEmail; - (NSString *) developerEmail;
/// This is the URL of the php/cgi/etc. page which the crash data will be POSTed to
- (void) setUploadURL:(NSString *)n; - (void) setUploadURL:(NSString *)n;
- (NSString *) uploadURL; - (NSString *) uploadURL;


/// The crash reporter's delegate is notified when the check has completed
@property (assign,readwrite) id delegate; @property (assign,readwrite) id delegate;


@end @end
4 changes: 2 additions & 2 deletions VVOpenSource.xcodeproj/project.pbxproj
Expand Up @@ -548,8 +548,8 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
32DBCF5E0370ADEE00C91783 /* VVOpenSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVOpenSource_Prefix.pch; sourceTree = "<group>"; }; 32DBCF5E0370ADEE00C91783 /* VVOpenSource_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VVOpenSource_Prefix.pch; sourceTree = "<group>"; };
5107014010E14BF200A67653 /* MutNRLockDict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutNRLockDict.h; sourceTree = "<group>"; }; 5107014010E14BF200A67653 /* MutNRLockDict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MutNRLockDict.h; path = VVBasics/src/MutNRLockDict.h; sourceTree = "<group>"; };
5107014110E14BF200A67653 /* MutNRLockDict.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MutNRLockDict.m; sourceTree = "<group>"; }; 5107014110E14BF200A67653 /* MutNRLockDict.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MutNRLockDict.m; path = VVBasics/src/MutNRLockDict.m; sourceTree = "<group>"; };
96017707108D71D6008F90CA /* VVCrashReporterEmailField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVCrashReporterEmailField.h; path = VVBasics/src/VVCrashReporterEmailField.h; sourceTree = "<group>"; }; 96017707108D71D6008F90CA /* VVCrashReporterEmailField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVCrashReporterEmailField.h; path = VVBasics/src/VVCrashReporterEmailField.h; sourceTree = "<group>"; };
96017708108D71D6008F90CA /* VVCrashReporterEmailField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VVCrashReporterEmailField.m; path = VVBasics/src/VVCrashReporterEmailField.m; sourceTree = "<group>"; }; 96017708108D71D6008F90CA /* VVCrashReporterEmailField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VVCrashReporterEmailField.m; path = VVBasics/src/VVCrashReporterEmailField.m; sourceTree = "<group>"; };
9601770B108D71EA008F90CA /* VVCrashReporterDescriptionField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVCrashReporterDescriptionField.h; path = VVBasics/src/VVCrashReporterDescriptionField.h; sourceTree = "<group>"; }; 9601770B108D71EA008F90CA /* VVCrashReporterDescriptionField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVCrashReporterDescriptionField.h; path = VVBasics/src/VVCrashReporterDescriptionField.h; sourceTree = "<group>"; };
Expand Down

0 comments on commit d37a617

Please sign in to comment.