PWFileLogger Class Reference

Inherits from NSObject
Conforms to PWLogger
Declared in PWFileLogger.h

  serviceName

The name of the service that corresponds to the logger.

@property (nonatomic, readonly) NSString *serviceName

Discussion

Each logger will only log messages tagged with the same service name as teh logger.

Declared In

PWFileLogger.h

  baseLevel

The base level of the logger.

@property (nonatomic) PWLogLevel baseLevel

Discussion

This property can be set to filter out log messages depending on their type. See the ‘PWLogLevel’ enum for more details.

Declared In

PWFileLogger.h

  asyncLogging

Indicates if the logger needs to execute in the background

@property (nonatomic, readonly) BOOL asyncLogging

Discussion

If the property is true, the logMessage: method will be executed using an asynchronous dispatch queue

Declared In

PWFileLogger.h

+ loggerWithServiceName:

Convenience constructor to create logger

+ (instancetype)loggerWithServiceName:(NSString *)serviceName

Parameters

serviceName

The service name that corresponds to the logger.

Declared In

PWFileLogger.h

– logMessage:

Logs a message using the logger.

- (void)logMessage:(PWLogMessage *)logMessage

Discussion

Log messages whose type is lower than the logger base level will cause this method to be called

Declared In

PWFileLogger.h

– logsDirectory

The directory where the logs files are stored.

- (NSString *)logsDirectory

Return Value

A string containing the directory where the logs files are stored.

Discussion

Each service will have its own logs directory.

Declared In

PWFileLogger.h

+ loggedServices

Provides an array of service names that have logged to a file.

+ (NSArray<NSString*> *)loggedServices

Return Value

An array of strings containing the service names logged.

Declared In

PWFileLogger.h

+ mergeLogFilesIntoSingleFileForService:error:

Merges all of the log files into a single file.

+ (NSString *)mergeLogFilesIntoSingleFileForService:(NSString *)serviceName error:(NSError **)error

Parameters

serviceName

The service name that corresponds to the log files.

error

On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

Return Value

A string containing the path to the merged log file.

Declared In

PWFileLogger.h