fix: file logger ensure directory exists
This commit is contained in:
parent
4c1018ddec
commit
33cb44bf36
@ -10,6 +10,10 @@ public class FileLogger : LoggerBase
|
|||||||
public FileLogger(string filePath)
|
public FileLogger(string filePath)
|
||||||
{
|
{
|
||||||
FilePath = filePath;
|
FilePath = filePath;
|
||||||
|
|
||||||
|
if (Path.GetDirectoryName(filePath) is string directoryPath)
|
||||||
|
Directory.CreateDirectory(directoryPath);
|
||||||
|
|
||||||
File.Open(filePath, FileMode.Create).Close();
|
File.Open(filePath, FileMode.Create).Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user