lindegroup/autopkgr — pull request #101 by eahrold (2014-08-09 19:53:18+00:00)
Title: initial commit for LGError Class

Basic error class to simplify populating of NSError objects.
Built to be expanded to fit the Error handling needs as development progresses.

Example Usage:
```Objective-c
NSError *error;
if ([LGError errorWithTaskError:aTask verb:kLGAutoPkgrRun error:&error]) {
// if this returns YES an error has occurred log it...
NSLog(@"%@",error.localizedDescription);
}

```
LGError.h
```Objective-c
+ (BOOL)errorWithCode:(LGErrorCodes)code error:(NSError **)error;
/**
* Generate an NSError Object for AutoPkgr
*
* @param code cooresponging LGErrorCodes
*
* @return Populated NSError Object if error code is != kLGErrorSuccess, nil otherwise;
*/
+ (NSError *)errorWithCode:(LGErrorCodes)code;

#pragma mark - NSTask Error
/**
* Populate an NSError using a completed NSTask
*
* @param task Completed NSTask Object
* @param verb Cooresponding Action Word Describing the AutoPkgr task process
* @param error __autoreleasing NSError object
*
* @return YES if Error has occured, NO if error.code = kLGErrorSuccess.
* @discussion If the task is not complete the error will return NO;
*/
+ (BOOL)errorWithTaskError:(NSTask *)task verb:(LGAutoPkgrVerb)verb error:(NSError **)error;
/**
* Generated NSError Object from and AutoPkgr NSTask
*
* @param task Completed NSTask Object
* @param verb Cooresponding Action Word Describing the AutoPkgr task process
*
* @return Populated NSError Object if exit status is != kLGErrorSuccess, nil otherwise;
* @discussion If the returned object will be nil if the task has not complete;
*/
+ (NSError *)errorWithTaskError:(NSTask *)task verb:(LGAutoPkgrVerb)verb;

```

This commit contains changes to the error handling in LGAutoPkgRunner Class' autopkg tasks

__The class also contains a new function__
```
DLog(format,...)
```
This can be used exactly like NSLog but it only logs messages when running a debug build. This will help reduce the amount of information logged in release builds.