Skip to content

Commit

Permalink
New [DDLog log:message:] primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
利辺羅エルネスト committed Mar 20, 2014
1 parent 06f0274 commit 7f8af2e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lumberjack/DDASLLogCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ + (void)aslMessageRecieved:(aslmsg)msg
options:0
timestamp:timeStamp];

[DDLog queueLogMessage:logMessage asynchronously:asynchronous];
[DDLog log:asynchronous message:logMessage];
}

+ (void)captureAslLogs
Expand Down
8 changes: 7 additions & 1 deletion Lumberjack/DDLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,14 @@ NSString *DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
format:(NSString *)format
args:(va_list)argList;

/**
* Logging Primitive.
*
* This method can be used if you manualy prepared DDLogMessage.
**/

+ (void)queueLogMessage:(DDLogMessage *)logMessage asynchronously:(BOOL)asyncFlag;
+ (void)log:(BOOL)asynchronous
message:(DDLogMessage *)logMessage;

/**
* Since logging can be asynchronous, there may be times when you want to flush the logs.
Expand Down
6 changes: 6 additions & 0 deletions Lumberjack/DDLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ + (void)log:(BOOL)asynchronous
}
}

+ (void)log:(BOOL)asynchronous
message:(DDLogMessage *)logMessage
{
[self queueLogMessage:logMessage asynchronously:asynchronous];
}

+ (void)flushLog
{
dispatch_sync(loggingQueue, ^{ @autoreleasepool {
Expand Down

0 comments on commit 7f8af2e

Please sign in to comment.