Skip to content

Commit

Permalink
Refactor > Convert to modern Objective-C syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Bürger committed Jun 25, 2012
1 parent 49a2003 commit 147b500
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
18 changes: 8 additions & 10 deletions Lumberjack/DDFileLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -1042,16 +1042,14 @@ - (NSTimeInterval)age

- (NSString *)description
{
return [[NSDictionary dictionaryWithObjectsAndKeys:
self.filePath, @"filePath",
self.fileName, @"fileName",
self.fileAttributes, @"fileAttributes",
self.creationDate, @"creationDate",
self.modificationDate, @"modificationDate",
[NSNumber numberWithUnsignedLongLong:self.fileSize], @"fileSize",
[NSNumber numberWithDouble:self.age], @"age",
[NSNumber numberWithBool:self.isArchived], @"isArchived",
nil] description];
return [@{@"filePath": self.filePath,
@"fileName": self.fileName,
@"fileAttributes": self.fileAttributes,
@"creationDate": self.creationDate,
@"modificationDate": self.modificationDate,
@"fileSize": @(self.fileSize),
@"age": @(self.age),
@"isArchived": @(self.isArchived)} description];
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions Lumberjack/Extensions/ContextFilterLogFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ - (void)addToSet:(int)loggingContext
{
OSSpinLockLock(&lock);
{
[set addObject:[NSNumber numberWithInt:loggingContext]];
[set addObject:@(loggingContext)];
}
OSSpinLockUnlock(&lock);
}
Expand All @@ -157,7 +157,7 @@ - (void)removeFromSet:(int)loggingContext
{
OSSpinLockLock(&lock);
{
[set removeObject:[NSNumber numberWithInt:loggingContext]];
[set removeObject:@(loggingContext)];
}
OSSpinLockUnlock(&lock);
}
Expand All @@ -181,7 +181,7 @@ - (BOOL)isInSet:(int)loggingContext

OSSpinLockLock(&lock);
{
result = [set containsObject:[NSNumber numberWithInt:loggingContext]];
result = [set containsObject:@(loggingContext)];
}
OSSpinLockUnlock(&lock);

Expand Down
2 changes: 1 addition & 1 deletion Lumberjack/Extensions/DispatchQueueLogFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage
NSString *abrvLabel;

if (useQueueLabel)
fullLabel = [NSString stringWithUTF8String:logMessage->queueLabel];
fullLabel = @(logMessage->queueLabel);
else
fullLabel = logMessage->threadName;

Expand Down

0 comments on commit 147b500

Please sign in to comment.