Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor > Convert to modern Objective-C syntax #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 8 additions & 10 deletions Lumberjack/DDFileLogger.m
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
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
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