diff --git a/Lumberjack/DDAbstractDatabaseLogger.m b/Lumberjack/DDAbstractDatabaseLogger.m index 1c8e0df00..735052124 100644 --- a/Lumberjack/DDAbstractDatabaseLogger.m +++ b/Lumberjack/DDAbstractDatabaseLogger.m @@ -239,7 +239,7 @@ - (void)createAndStartDeleteTimer - (NSUInteger)saveThreshold { - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) { return saveThreshold; } @@ -279,7 +279,7 @@ - (void)setSaveThreshold:(NSUInteger)threshold } }; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -287,7 +287,7 @@ - (void)setSaveThreshold:(NSUInteger)threshold - (NSTimeInterval)saveInterval { - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) { return saveInterval; } @@ -362,7 +362,7 @@ - (void)setSaveInterval:(NSTimeInterval)interval } }; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -370,7 +370,7 @@ - (void)setSaveInterval:(NSTimeInterval)interval - (NSTimeInterval)maxAge { - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) { return maxAge; } @@ -451,7 +451,7 @@ - (void)setMaxAge:(NSTimeInterval)interval } }; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -459,7 +459,7 @@ - (void)setMaxAge:(NSTimeInterval)interval - (NSTimeInterval)deleteInterval { - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) { return deleteInterval; } @@ -533,7 +533,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval } }; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -541,7 +541,7 @@ - (void)setDeleteInterval:(NSTimeInterval)interval - (BOOL)deleteOnEverySave { - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) { return deleteOnEverySave; } @@ -564,7 +564,7 @@ - (void)setDeleteOnEverySave:(BOOL)flag deleteOnEverySave = flag; }; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -581,7 +581,7 @@ - (void)savePendingLogEntries [self performSaveAndSuspendSaveTimer]; }}; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); @@ -594,7 +594,7 @@ - (void)deleteOldLogEntries [self performDelete]; }}; - if (dispatch_get_current_queue() == loggerQueue) + if (dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) == loggerQueue) block(); else dispatch_async(loggerQueue, block); diff --git a/Lumberjack/DDFileLogger.m b/Lumberjack/DDFileLogger.m index 531b3989b..bf9cf934b 100644 --- a/Lumberjack/DDFileLogger.m +++ b/Lumberjack/DDFileLogger.m @@ -528,7 +528,7 @@ - (unsigned long long)maximumFileSize // Note: The internal implementation should access the maximumFileSize variable directly, // but if we forget to do this, then this method should at least work properly. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { return maximumFileSize; @@ -562,7 +562,7 @@ - (void)setMaximumFileSize:(unsigned long long)newMaximumFileSize }}; - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -586,7 +586,7 @@ - (NSTimeInterval)rollingFrequency // Note: The internal implementation should access the rollingFrequency variable directly, // but if we forget to do this, then this method should at least work properly. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { return rollingFrequency; @@ -620,7 +620,7 @@ - (void)setRollingFrequency:(NSTimeInterval)newRollingFrequency }}; - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -700,7 +700,7 @@ - (void)rollLogFile [self rollLogFileNow]; }}; - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); diff --git a/Lumberjack/DDLog.m b/Lumberjack/DDLog.m index 9b09ac1c1..09e514253 100755 --- a/Lumberjack/DDLog.m +++ b/Lumberjack/DDLog.m @@ -868,7 +868,7 @@ - (id)initWithLogMsg:(NSString *)msg machThreadID = pthread_mach_thread_np(pthread_self()); - queueLabel = dd_str_copy(dispatch_queue_get_label(dispatch_get_current_queue())); + queueLabel = dd_str_copy(dispatch_queue_get_label(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0))); threadName = [[NSThread currentThread] name]; } @@ -996,7 +996,7 @@ - (void)logMessage:(DDLogMessage *)logMessage // So direct access to the formatter is only available if requested from the loggerQueue. // In all other circumstances we need to go through the loggingQueue to get the proper value. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { return formatter; @@ -1038,7 +1038,7 @@ - (void)setLogFormatter:(id )logFormatter } }}; - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); diff --git a/Lumberjack/DDTTYLogger.m b/Lumberjack/DDTTYLogger.m index 8a9c8b2db..648173514 100755 --- a/Lumberjack/DDTTYLogger.m +++ b/Lumberjack/DDTTYLogger.m @@ -867,7 +867,7 @@ - (BOOL)colorsEnabled // The design of this method is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { return colorsEnabled; @@ -903,7 +903,7 @@ - (void)setColorsEnabled:(BOOL)newColorsEnabled // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -956,7 +956,7 @@ - (void)setForegroundColor:(OSColor *)txtColor backgroundColor:(OSColor *)bgColo // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -992,7 +992,7 @@ - (void)setForegroundColor:(OSColor *)txtColor backgroundColor:(OSColor *)bgColo // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -1037,7 +1037,7 @@ - (void)clearColorsForFlag:(int)mask context:(int)context // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -1065,7 +1065,7 @@ - (void)clearColorsForTag:(id )tag // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -1091,7 +1091,7 @@ - (void)clearColorsForAllFlags // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -1117,7 +1117,7 @@ - (void)clearColorsForAllTags // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block(); @@ -1144,7 +1144,7 @@ - (void)clearAllColors // The design of the setter logic below is taken from the DDAbstractLogger implementation. // For documentation please refer to the DDAbstractLogger implementation. - dispatch_queue_t currentQueue = dispatch_get_current_queue(); + dispatch_queue_t currentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); if (currentQueue == loggerQueue) { block();