diff options
Diffstat (limited to 'Source/SPLogger.h')
-rw-r--r-- | Source/SPLogger.h | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/Source/SPLogger.h b/Source/SPLogger.h index ac9b9a04..09fbfd53 100644 --- a/Source/SPLogger.h +++ b/Source/SPLogger.h @@ -27,13 +27,50 @@ @interface SPLogger : NSObject { + /** + * Dump leaks on termination flag. + */ + BOOL dumpLeaksOnTermination; + + /** + * Log file initialized successfully flag. + */ BOOL initializedSuccessfully; + + /** + * Log file handle. + */ NSFileHandle *logFileHandle; } +/** + * Returns the shared logger. + * + * @return The logger instance + */ + (SPLogger *)logger; -- (void) outputTimeString; -- (void) log:(NSString *)theString, ...; +/** + * Tells the logger to dump leaks analysis upon app termination. + */ +- (void)setDumpLeaksOnTermination; + +/** + * Dumps the result of running leaks to the file '/tmp/sp.leaks.<pid>.tmp'. + * + * Note, that to enable useful output, make sure the following environment variables are set to YES: + * + * MallocStackLogging + * MallocStackLoggingNoCompact + * + * Also note that the application may take a while to terminate if it has been running for a significant + * period of time or has been handling large amounts of data. + */ +- (void)dumpLeaks; + +/** + * Logs the supplied string to the log file. + */ +- (void)log:(NSString *)theString, ...; @end |