IOS Streaming Browser 1.0
An IOS streaming browser to stream the display to others or to a projector

DDFileLogger Class Reference

#import <DDFileLogger.h>

Inheritance diagram for DDFileLogger:
Collaboration diagram for DDFileLogger:

Public Member Functions

(id) - init
(id) - initWithLogFileManager:
(void) - rollLogFile
(void) - lt_getMaximumFileSize:
(void) - lt_setMaximumFileSize:
(void) - lt_getRollingFrequency:
(void) - lt_setRollingFrequency:
(void) - rollLogFileNow
(void) - maybeRollLogFileDueToAge:
(void) - maybeRollLogFileDueToSize

Protected Attributes

DDLogFileInfocurrentLogFileInfo
NSFileHandle * currentLogFileHandle
NSTimer * rollingTimer

Properties

unsigned long long maximumFileSize
NSTimeInterval rollingFrequency
id< DDLogFileManagerlogFileManager

Detailed Description

Definition at line 171 of file DDFileLogger.h.


Member Function Documentation

- (id) init

Initialize the DDFileLogger

Definition at line 540 of file DDFileLogger.m.

{
        DDLogFileManagerDefault *defaultLogFileManager = [[[DDLogFileManagerDefault alloc] init] autorelease];
        
        return [self initWithLogFileManager:defaultLogFileManager];
}
- (id) initWithLogFileManager: (id <DDLogFileManager>)  logFileManager

Initialize the DDFileLogger with a file manager

Definition at line 550 of file DDFileLogger.m.

                            :(id <DDLogFileManager>)aLogFileManager
{
        if ((self = [super init]))
        {
                maximumFileSize = DEFAULT_LOG_MAX_FILE_SIZE;
                rollingFrequency = DEFAULT_LOG_ROLLING_FREQUENCY;
                
                logFileManager = [aLogFileManager retain];
                
                formatter = [[DDLogFileFormatterDefault alloc] init];
        }
        return self;
}
- (void) lt_getMaximumFileSize: (NSMutableArray *)  resultHolder

param NSMutableArray

- (void) lt_getRollingFrequency: (NSMutableArray *)  resultHolder

param NSMutableArray

- (void) lt_setMaximumFileSize: (NSNumber *)  maximumFileSizeWrapper

param NSNumber

- (void) lt_setRollingFrequency: (NSNumber *)  rollingFrequencyWrapper

param NSNumber

- (void) maybeRollLogFileDueToAge: (NSTimer *)  aTimer

param NSTimer

- (void) maybeRollLogFileDueToSize
- (void) rollLogFile

You can optionally force the current log file to be rolled with this method.

Definition at line 916 of file DDFileLogger.m.

{
        // This method is public.
        // We need to execute the rolling on our logging thread/queue.
        
        if (IS_GCD_AVAILABLE)
        {
        #if GCD_MAYBE_AVAILABLE
                
                dispatch_block_t block = ^{
                        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                        [self rollLogFileNow];
                        [pool release];
                };
                dispatch_async([DDLog loggingQueue], block);
                
        #endif
        }
        else
        {
        #if GCD_MAYBE_UNAVAILABLE
                
                [self performSelector:@selector(rollLogFileNow)
                             onThread:[DDLog loggingThread]
                           withObject:nil
                        waitUntilDone:NO];
                
        #endif
        }
}
- (void) rollLogFileNow

Field Documentation

- (NSFileHandle *) currentLogFileHandle [protected]

The NSFileHandle class is an object-oriented wrapper for a file descriptor

returns NSFileHandle

Definition at line 187 of file DDFileLogger.h.

- (DDLogFileInfo *) currentLogFileInfo [protected]

Returns the log file that should be used. If there is an existing log file that is suitable, within the constraints of maximumFileSize and rollingFrequency, then it is returned.

Otherwise a new file is created and returned.

Definition at line 182 of file DDFileLogger.h.

- (NSTimer*) rollingTimer [protected]

Definition at line 192 of file DDFileLogger.h.


Property Documentation

- (id< DDLogFileManager >) logFileManager [read, assign]

Definition at line 177 of file DDFileLogger.h.

- (unsigned long long) maximumFileSize [read, write, assign]

The maximum file size has to be between 0 and 9,223,372,036,854,775,807

Gets the maximum file size. This value can be between 0 and 9,223,372,036,854,775,807 returns unsigned long long.

Definition at line 197 of file DDFileLogger.h.

- (NSTimeInterval) rollingFrequency [read, write, assign]

returns NSTimeInterval

Definition at line 202 of file DDFileLogger.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Defines