Last active
August 29, 2015 14:15
-
-
Save sgtsquiggs/51b63016a763ec0a2d22 to your computer and use it in GitHub Desktop.
ARAnalyticsLogger
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
// | |
// ARAnalyticsLogger.h | |
// | |
// Created by Matthew Crenshaw on 2/12/15. | |
// Copyright (c) 2015 Batoul Apps. All rights reserved. | |
// | |
#import <CocoaLumberjack/DDLog.h> | |
@interface ARAnalyticsLogger : DDAbstractLogger | |
+ (ARAnalyticsLogger *)sharedInstance; | |
@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
// | |
// ARAnalyticsLogger.m | |
// | |
// Created by Matthew Crenshaw on 2/12/15. | |
// Copyright (c) 2015 Batoul Apps. All rights reserved. | |
// | |
#import "ARAnalyticsLogger.h" | |
OBJC_EXTERN void ARLog (NSString *format, ...) NS_FORMAT_FUNCTION(1,2); | |
@implementation ARAnalyticsLogger | |
- (void)logMessage:(DDLogMessage *)logMessage | |
{ | |
NSString *logMsg = logMessage->_message; | |
if (_logFormatter) | |
{ | |
logMsg = [_logFormatter formatLogMessage:logMessage]; | |
} | |
if (logMsg) | |
{ | |
ARLog(@"%@", logMsg); | |
} | |
} | |
+ (ARAnalyticsLogger *) sharedInstance | |
{ | |
static dispatch_once_t pred = 0; | |
static ARAnalyticsLogger *_sharedInstance = nil; | |
dispatch_once(&pred, ^{ | |
_sharedInstance = [[self alloc] init]; | |
}); | |
return _sharedInstance; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment