Modify -logFilePath to compute path every time

If IRCChannel doesn't yet have an instance of TLOFileLogger to retrieve the value of writePath from, it will compute the path dynamically. But if there is an instance of TLOFileLogger, it will ask for writePath. But writePath is only valid when the file handle is open. The file handle is closed automatically if logging becomes idle. You don't want to have ton of file handles open if you aren't using them. So you then have edge case where user goes to open a previously active channel and there is no file path returned from TLOFileLogger because it's idle closed.
This commit is contained in:
Michael
2024-06-16 19:34:45 -04:00
parent 06612c8409
commit 37693ec0d7
+1 -7
View File
@@ -247,13 +247,7 @@ DESIGNATED_INITIALIZER_EXCEPTION_BODY_END
- (nullable NSURL *)logFilePath
{
NSString *writePath = nil;
if (self.logFile == nil) {
writePath = [TLOFileLogger writePathForItem:self];
} else {
writePath = self.logFile.writePath;
}
NSString *writePath = [TLOFileLogger writePathForItem:self];
if (writePath == nil) {
return nil;