From 3d5b11d828352fa896b0d777a8f3a3e49a72c033 Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Sat, 20 Apr 2019 23:55:39 -0700 Subject: [PATCH] =Fixed OutputLog Changed outputlog to save to dated filename --- src/core/lua/Plugin.java | 4 +--- src/utils/GlobalLog.java | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/core/lua/Plugin.java b/src/core/lua/Plugin.java index b58a87c..e022db7 100644 --- a/src/core/lua/Plugin.java +++ b/src/core/lua/Plugin.java @@ -35,11 +35,9 @@ public class Plugin contents = contentBuilder.toString(); globals = JsePlatform.standardGlobals(); - + globals.load(contents).call(); func_plugin = globals.get("plugin"); - - String output = null; } catch (IOException e) { diff --git a/src/utils/GlobalLog.java b/src/utils/GlobalLog.java index 81777c9..fcd9b6f 100644 --- a/src/utils/GlobalLog.java +++ b/src/utils/GlobalLog.java @@ -3,6 +3,9 @@ package utils; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; public class GlobalLog { @@ -14,7 +17,9 @@ public class GlobalLog public static void initialize() throws FileNotFoundException, UnsupportedEncodingException { - outputLog = new PrintWriter("OutputLog.txt", "UTF-8"); + DateFormat dF = new SimpleDateFormat("yyyy_MM_dd_HH-mm"); + Date today = new Date(); + outputLog = new PrintWriter((dF.format(today) + "Log.txt"), "UTF-8"); } private static void Write(String status, LogFilter filter, String body)