From 7ca099d0d02e91d7ec5be218e3f1a7573f4214f5 Mon Sep 17 00:00:00 2001
From: Peter Evans <peter@modul8r.com>
Date: Thu, 29 Mar 2018 21:42:38 -0500
Subject: [PATCH] Open log file rather than use stdout

---
 src/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 9842a23..b2a9b82 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,7 +48,12 @@ init(int argc, char **argv)
 
     vm_di_set(VM_OUTPUT, stdout);
 
-    log_open(stdout);
+    FILE *stream = fopen(LOG_FILENAME, "w");
+    if (stream == NULL) {
+        perror("Can't open log file");
+    }
+
+    log_open(stream);
 
     if (vm_screen_init() != OK) {
         fprintf(stderr, "Couldn't initialize video\n");