mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user