X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosLog.java;h=9241581a2049e0f8c303307173c5a611cd5799b5;hb=4e53a5da5a8921829a3bb290e7c051950a66ab75;hp=015d9f65aa13ad28ef3aadef04bcf044becabf12;hpb=4e22b34bde421a9df090c9196fd4347468c8176a;p=fw%2Faltos diff --git a/altoslib/AltosLog.java b/altoslib/AltosLog.java index 015d9f65..9241581a 100644 --- a/altoslib/AltosLog.java +++ b/altoslib/AltosLog.java @@ -15,7 +15,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -package org.altusmetrum.altoslib_2; +package org.altusmetrum.altoslib_6; import java.io.*; import java.text.*; @@ -48,6 +48,7 @@ public class AltosLog implements Runnable { } public void close() { + link.remove_monitor(input_queue); close_log_file(); if (log_thread != null) { log_thread.interrupt(); @@ -59,21 +60,19 @@ public class AltosLog implements Runnable { return file; } - boolean open (AltosState state) throws IOException { + boolean open (AltosState state) throws IOException, InterruptedException { AltosFile a = new AltosFile(state); log_file = new FileWriter(a, true); if (log_file != null) { while (!pending_queue.isEmpty()) { - try { - String s = pending_queue.take(); - log_file.write(s); - log_file.write('\n'); - } catch (InterruptedException ie) { - } + String s = pending_queue.take(); + log_file.write(s); + log_file.write('\n'); } log_file.flush(); file = a; + AltosPreferences.set_logfile(link.serial, file); } return log_file != null; }