Skip to content

Instantly share code, notes, and snippets.

@xNekOIx
Last active December 21, 2015 06:59
Show Gist options
  • Save xNekOIx/6268135 to your computer and use it in GitHub Desktop.
Save xNekOIx/6268135 to your computer and use it in GitHub Desktop.
// Inspired by Mattt
@interface NOLoggingAssertionHandler : NSAssertionHandler
@end
@implementation NOLoggingAssertionHandler
- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format, ...
{
va_list args;
va_start(args, format);
NSString* errorDescription = [[NSString alloc] initWithFormat:format arguments:args];
va_end(args);
TFLog(@"NSAssert Failure: Method %@ for object %@ in %@#%i, descriprion: %@", NSStringFromSelector(selector), object, fileName, line, errorDescription);
}
- (void)handleFailureInFunction:(NSString *)functionName file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format, ...
{
va_list args;
va_start(args, format);
NSString* errorDescription = [[NSString alloc] initWithFormat:format arguments:args];
va_end(args);
TFLog(@"NSCAssert Failure: Function (%@) in %@#%i, descriprion: %@", functionName, fileName, line, errorDescription);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment