Skip to content

Instantly share code, notes, and snippets.

@chrisrichards
Last active August 2, 2017 08:33
Show Gist options
  • Save chrisrichards/b3fac453b005085c2ca1 to your computer and use it in GitHub Desktop.
Save chrisrichards/b3fac453b005085c2ca1 to your computer and use it in GitHub Desktop.
Custom CocoaLumberjack logger for LogEntries.
//
// 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
//
// 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
@jlnbuiles
Copy link

thanks! this was helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment