From 6092f9ea00f63980231a646696671ae9db3fa958 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 8 Feb 2017 00:22:27 -0500 Subject: always use \r\n line endings in log file for crossplatform compatibility (#230) --- release-notes.md | 1 + src/StardewModdingAPI/Framework/LogFileManager.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release-notes.md b/release-notes.md index 9b6bd4fb..47902e22 100644 --- a/release-notes.md +++ b/release-notes.md @@ -12,6 +12,7 @@ For mod developers: * Added `GetPrivateProperty` to reflection helper. * Many deprecated APIs have been removed; see the [deprecation guide](http://canimod.com/guides/updating-a-smapi-mod) for more information. +* Log files now always use `\r\n` to simplify crossplatform viewing. ## 1.8 See [log](https://github.com/Pathoschild/SMAPI/compare/1.7...1.8). diff --git a/src/StardewModdingAPI/Framework/LogFileManager.cs b/src/StardewModdingAPI/Framework/LogFileManager.cs index c2a2105b..80437e9c 100644 --- a/src/StardewModdingAPI/Framework/LogFileManager.cs +++ b/src/StardewModdingAPI/Framework/LogFileManager.cs @@ -34,7 +34,9 @@ namespace StardewModdingAPI.Framework /// The message to log. public void WriteLine(string message) { - this.Stream.WriteLine(message); + // always use Windows-style line endings for convenience + // (Linux/Mac editors are fine with them, Windows editors often require them) + this.Stream.Write(message + "\r\n"); } /// Release all resources. -- cgit