From bf3ed26a8b6480a12c7e62f483234d8c616fae28 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 21 May 2017 17:58:17 -0400 Subject: fix smapi-crash.txt being copied from default log even if --log-path is specified --- src/StardewModdingAPI/Framework/Logging/LogFileManager.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/StardewModdingAPI/Framework/Logging') diff --git a/src/StardewModdingAPI/Framework/Logging/LogFileManager.cs b/src/StardewModdingAPI/Framework/Logging/LogFileManager.cs index 1f6ade1d..8cfe0527 100644 --- a/src/StardewModdingAPI/Framework/Logging/LogFileManager.cs +++ b/src/StardewModdingAPI/Framework/Logging/LogFileManager.cs @@ -13,6 +13,13 @@ namespace StardewModdingAPI.Framework.Logging private readonly StreamWriter Stream; + /********* + ** Accessors + *********/ + /// The full path to the log file being written. + public string Path { get; } + + /********* ** Public methods *********/ @@ -20,8 +27,10 @@ namespace StardewModdingAPI.Framework.Logging /// The log file to write. public LogFileManager(string path) { + this.Path = path; + // create log directory if needed - string logDir = Path.GetDirectoryName(path); + string logDir = System.IO.Path.GetDirectoryName(path); if (logDir == null) throw new ArgumentException($"The log path '{path}' is not valid."); Directory.CreateDirectory(logDir); -- cgit