Blob Blame History Raw
diff -r b02ae452f99f plugin/icedteanp/IcedTeaNPPlugin.cc
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Thu Sep 24 16:32:30 2015 +0200
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc	Tue Sep 29 13:15:10 2015 +0200
@@ -241,6 +241,7 @@
 static guint appletviewer_watch_id = -1;
 
 bool debug_initiated = false;
+bool file_logs_initiated = false;
 int plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL;
 bool plugin_debug_headers = false;
 bool plugin_debug_to_file = false ;
diff -r b02ae452f99f plugin/icedteanp/IcedTeaNPPlugin.h
--- a/plugin/icedteanp/IcedTeaNPPlugin.h	Thu Sep 24 16:32:30 2015 +0200
+++ b/plugin/icedteanp/IcedTeaNPPlugin.h	Tue Sep 29 13:15:10 2015 +0200
@@ -117,6 +117,7 @@
 
 // debug switches
 extern bool debug_initiated;
+extern bool file_logs_initiated;
 extern int plugin_debug;
 extern bool plugin_debug_headers;
 extern bool plugin_debug_to_file;
diff -r b02ae452f99f plugin/icedteanp/IcedTeaPluginUtils.h
--- a/plugin/icedteanp/IcedTeaPluginUtils.h	Thu Sep 24 16:32:30 2015 +0200
+++ b/plugin/icedteanp/IcedTeaPluginUtils.h	Tue Sep 29 13:15:10 2015 +0200
@@ -86,6 +86,7 @@
       plugin_debug_to_console = is_java_console_enabled();                    \
       if (plugin_debug_to_file) {                                             \
            IcedTeaPluginUtilities::initFileLog();                             \
+           file_logs_initiated = true;                                        \
       }                                                                       \
       if (plugin_debug_to_console) {                                          \
           /*initialisation done during jvm startup*/                          \
@@ -134,7 +135,7 @@
         snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \
         fprintf  (stdout, "%s", ldebug_message);\
       }                                \
-      if (plugin_debug_to_file) {      \
+      if (plugin_debug_to_file && file_logs_initiated) {      \
         snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body);   \
         fprintf (plugin_file_log, "%s", ldebug_message);   \
         fflush(plugin_file_log);       \
@@ -180,7 +181,7 @@
       snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \
       fprintf  (stderr, "%s", ldebug_message);                                    \
     }                                  \
-    if (plugin_debug_to_file) {        \
+    if (plugin_debug_to_file && file_logs_initiated) {        \
       snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \
       fprintf (plugin_file_log, "%s", ldebug_message);   \
       fflush(plugin_file_log);         \