Last active
December 21, 2015 06:59
-
-
Save xNekOIx/6268135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by Mattt | |
@interface NOLoggingAssertionHandler : NSAssertionHandler | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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