Skip to content

Commit

Permalink
Update code for CocoaLumberjack 2.0.0-beta4 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernesto Rivera committed Nov 7, 2014
1 parent 7a55a08 commit e795ee4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Source/PTEConsoleLogger.m
Expand Up @@ -114,16 +114,16 @@ - (void)logMessage:(DDLogMessage *)logMessage

- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
{
if (self->formatter)
if (_logFormatter)
{
return [self->formatter formatLogMessage:logMessage];
return [_logFormatter formatLogMessage:logMessage];
}
else
{
return [NSString stringWithFormat:@"%@:%d %@",
return [NSString stringWithFormat:@"%@:%@ %@",
logMessage.fileName,
logMessage->lineNumber,
logMessage->logMsg];
@(logMessage->_line),
logMessage->_message];
}
}

Expand All @@ -135,7 +135,7 @@ - (NSString *)formatShortLogMessage:(DDLogMessage *)logMessage
}
else
{
return [[logMessage->logMsg
return [[logMessage->_message
stringByReplacingOccurrencesOfString:@" " withString:@""]
stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
}
Expand All @@ -161,7 +161,7 @@ - (void)clearConsole
- (void)addMarker
{
PTEMarkerLogMessage * marker = PTEMarkerLogMessage.new;
marker->logMsg = [NSString stringWithFormat:@"Marker %@", NSDate.date];
marker->_message = [NSString stringWithFormat:@"Marker %@", NSDate.date];
[self logMessage:marker];
}

Expand Down Expand Up @@ -445,11 +445,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView
// Configure the label
if (marker)
{
label.text = logMessage->logMsg;
label.text = logMessage->_message;
}
else
{
switch (logMessage->logFlag)
switch (logMessage->_flag)
{
case DDLogFlagError : label.textColor = [UIColor redColor]; break;
case DDLogFlagWarning : label.textColor = [UIColor orangeColor]; break;
Expand All @@ -466,7 +466,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView
- (NSString *)textForCellWithLogMessage:(DDLogMessage *)logMessage
{
NSString * prefix;
switch (logMessage->logFlag)
switch (logMessage->_flag)
{
case DDLogFlagError : prefix = @""; break;
case DDLogFlagWarning : prefix = @""; break;
Expand Down Expand Up @@ -535,7 +535,7 @@ - (BOOL)messagePassesFilter:(DDLogMessage *)message
{
// Message is a marker OR (Log flag matches AND (no search text OR contains search text))
return ([message isKindOfClass:[PTEMarkerLogMessage class]] ||
((message->logFlag & _currentLogLevel) &&
((message->_flag & _currentLogLevel) &&
(_currentSearchText.length == 0 ||
[[self formatLogMessage:message] rangeOfString:_currentSearchText
options:(NSCaseInsensitiveSearch |
Expand Down

0 comments on commit e795ee4

Please sign in to comment.