Skip to content

Commit

Permalink
Change iOS logging directory to use cache directory instead of docume…
Browse files Browse the repository at this point in the history
…nts directory

This way the log files will not be part of the iCloud backup
  • Loading branch information
DerAndereAndi committed Feb 5, 2012
1 parent 228cdf7 commit 3bf4585
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lumberjack/DDFileLogger.h
Expand Up @@ -97,7 +97,7 @@
// All log files are placed inside the logsDirectory.
// If a specific logsDirectory isn't specified, the default directory is used.
// On Mac, this is in ~/Library/Application Support/<Application Name>/Logs.
// On iPhone, this is in ~/Documents/Logs.
// On iPhone, this is in ~/Library/Caches/Logs.
//
// Log files are named "log-<uuid>.txt",
// where uuid is a 6 character hexadecimal consisting of the set [0123456789ABCDEF].
Expand Down
2 changes: 1 addition & 1 deletion Lumberjack/DDFileLogger.m
Expand Up @@ -180,7 +180,7 @@ - (void)deleteOldLogFiles
- (NSString *)defaultLogsDirectory
{
#if TARGET_OS_IPHONE
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *baseDir = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSString *logsDirectory = [baseDir stringByAppendingPathComponent:@"Logs"];

Expand Down

0 comments on commit 3bf4585

Please sign in to comment.