Skip to content

Commit

Permalink
Add missing method implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Dec 18, 2023
1 parent 1000dd8 commit 764a11f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Sources/CocoaLumberjack/DDFileLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,11 @@ @implementation DDLogFileManagerDefault
@synthesize logFilesDiskQuota = _logFilesDiskQuota;
@synthesize logMessageSerializer = _logMessageSerializer;

- (instancetype)init {
return [self initWithLogsDirectory:nil];
}

- (instancetype)initWithLogsDirectory:(nullable NSString *)aLogsDirectory {
if ((self = [super init])) {
_maximumNumberOfLogFiles = kDDDefaultLogMaxNumLogFiles;
_logFilesDiskQuota = kDDDefaultLogFilesDiskQuota;
_wasAddedToLogger = NO;

_fileDateFormatter = [[NSDateFormatter alloc] init];
[_fileDateFormatter setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]];
Expand Down Expand Up @@ -139,6 +136,15 @@ - (instancetype)initWithLogsDirectory:(NSString *)logsDirectory
}
#endif

- (instancetype)init {
return [self initWithLogsDirectory:nil];
}

- (void)didAddToFileLogger:(DDFileLogger *)fileLogger {
NSAssert(!_wasAddedToLogger, @"Added to logger multiple times!");
_wasAddedToLogger = YES;
}

- (void)deleteOldFilesForConfigurationChange {
if (!_wasAddedToLogger) return;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
Expand Down

0 comments on commit 764a11f

Please sign in to comment.