Skip to content

Commit

Permalink
Updating documentation for DispatchQueueLogFormatter. Moving private …
Browse files Browse the repository at this point in the history
…ivars into *.m file.
  • Loading branch information
robbiehanson committed Oct 29, 2012
1 parent 585d7cf commit 4d39ecd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Lumberjack/Extensions/DispatchQueueLogFormatter.h
Expand Up @@ -49,22 +49,10 @@
* Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread),
* you can use [[NSThread currentThread] setName:(NSString *)].
**/
@interface DispatchQueueLogFormatter : NSObject <DDLogFormatter>
{
@protected
@interface DispatchQueueLogFormatter : NSObject <DDLogFormatter> {
@protected

NSString *dateFormatString;

@private

int32_t atomicLoggerCount;
NSDateFormatter *threadUnsafeDateFormatter; // Use [self stringFromDate]

OSSpinLock lock;

NSUInteger _minQueueLength; // _prefix == Only access via atomic property
NSUInteger _maxQueueLength; // _prefix == Only access via atomic property
NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock
}

/**
Expand All @@ -87,23 +75,29 @@
* If the minQueueLength is 8: [diskIO ]
*
* The default minQueueLength is 0 (no minimum, so [detail box] won't be padded).
*
* If you want every [detail box] to have the exact same width,
* set both minQueueLength and maxQueueLength to the same value.
**/
@property (assign) NSUInteger minQueueLength;

/**
* The maxQueueLength restricts the number of characters that will be inside the [detail box].
* If the maxQueueLength is 0, there is no restriction.
* For example:
*
* Say a dispatch_queue has a label of "diskIO". (standardizedQueueLength==NO)
* For example, say a dispatch_queue has a label of "diskIO":
*
* If the maxQueueLength is 0: [diskIO]
* If the maxQueueLength is 4: [disk]
* If the maxQueueLength is 5: [diskI]
* If the maxQueueLength is 6: [diskIO]
* If the maxQueueLength is 7: [diskIO]
* If the maxQueueLength is 8: [diskIO]
*
* The default maxQueueLength is 0 (no maximum, so [thread box] queue names won't be truncated).
* The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated).
*
* If you want every [detail box] to have the exact same width,
* set both minQueueLength and maxQueueLength to the same value.
**/
@property (assign) NSUInteger maxQueueLength;

Expand Down
10 changes: 10 additions & 0 deletions Lumberjack/Extensions/DispatchQueueLogFormatter.m
Expand Up @@ -17,6 +17,16 @@


@implementation DispatchQueueLogFormatter
{
int32_t atomicLoggerCount;
NSDateFormatter *threadUnsafeDateFormatter; // Use [self stringFromDate]

OSSpinLock lock;

NSUInteger _minQueueLength; // _prefix == Only access via atomic property
NSUInteger _maxQueueLength; // _prefix == Only access via atomic property
NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock
}

- (id)init
{
Expand Down

0 comments on commit 4d39ecd

Please sign in to comment.