From 7f3f764388a29a31305b167962e0a201d0348388 Mon Sep 17 00:00:00 2001
From: Domink Sigmund <sigmund.dominik@googlemail.com>
Date: Fri, 28 Sep 2018 10:14:05 +0200
Subject: [PATCH] FileWrite is now non-blocking

---
 index.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 096a6a0..57c15b2 100644
--- a/index.js
+++ b/index.js
@@ -59,7 +59,11 @@ function Log (options) {
         console.log(msg)
     }
     if (this.options.file) {
-      this.fs.appendFileSync(this.options.file, msg + '\n')
+      this.fs.appendFile(this.options.file, msg + '\n', function (error) {
+        if (error) {
+          console.error('Cannot write to File ' + this.options.file)
+        }
+      })
     }
     if (this.options.graylog) {
       switch (tag) {
-- 
GitLab