From d6bd039602e7b717844b931971c5832c51264d27 Mon Sep 17 00:00:00 2001 From: TimosCodd Date: Tue, 5 Dec 2023 22:41:09 +0100 Subject: [PATCH] :stethoscope: Log file --- CS-Jukebox/Program.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CS-Jukebox/Program.cs b/CS-Jukebox/Program.cs index 819d781..d3d0c7c 100644 --- a/CS-Jukebox/Program.cs +++ b/CS-Jukebox/Program.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; @@ -11,9 +12,16 @@ static class Program /// /// The main entry point for the application. /// + /// + [STAThread] static void Main() { + FileStream filestream = new FileStream("log.txt", FileMode.Create); + var streamwriter = new System.IO.StreamWriter(filestream); + streamwriter.AutoFlush = true; + Console.SetOut(streamwriter); + Console.SetError(streamwriter); Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false);