Last active
August 2, 2017 08:33
-
-
Save chrisrichards/b3fac453b005085c2ca1 to your computer and use it in GitHub Desktop.
Custom CocoaLumberjack logger for LogEntries.
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
// | |
// LogEntriesLogger.h | |
// lcinventories | |
// | |
// Created by Chris Richards on 17/11/2014. | |
// Copyright (c) 2014 Yellow Feather Ltd. All rights reserved. | |
// | |
#import "DDLog.h" | |
@interface LogEntriesLogger : DDAbstractLogger<DDLogger> | |
@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
// | |
// LogEntriesLogger.m | |
// lcinventories | |
// | |
// Created by Chris Richards on 17/11/2014. | |
// Copyright (c) 2014 Yellow Feather Ltd. All rights reserved. | |
// | |
#import "LogEntriesLogger.h" | |
@implementation LogEntriesLogger | |
- (void)logMessage:(DDLogMessage *)logMessage | |
{ | |
NSString *logMsg = logMessage->_message; | |
if (self->_logFormatter) { | |
logMsg = [self->_logFormatter formatLogMessage:logMessage]; | |
} | |
if (logMsg) { | |
LELog* log = [LELog sharedInstance]; | |
[log log:logMsg]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks! this was helpful :)