summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-02-10 22:06:43 +0100
committerArne Schwabe <arne@rfc2549.org>2013-02-10 22:06:43 +0100
commit50299529d61e9c256e77cf220fa0ecc3f74a18bf (patch)
tree7093a79e64f0acf8ecedc0bab38ac17e2a176d81
parent2a9f7fcdb1ddf8c2ee39ed87334bf0bc58955808 (diff)
When logging a crash add time stamps
-rw-r--r--src/de/blinkt/openvpn/OpenVPNThread.java7
-rw-r--r--src/de/blinkt/openvpn/OpenVpnService.java17
2 files changed, 6 insertions, 18 deletions
diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java
index 67878eb7..2bdffe95 100644
--- a/src/de/blinkt/openvpn/OpenVPNThread.java
+++ b/src/de/blinkt/openvpn/OpenVPNThread.java
@@ -6,7 +6,10 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.text.SimpleDateFormat;
+import java.util.Date;
import java.util.LinkedList;
+import java.util.Locale;
import android.util.Log;
import de.blinkt.openvpn.OpenVPN.LogItem;
@@ -58,8 +61,10 @@ public class OpenVPNThread implements Runnable {
if(mDumpPath!=null) {
try {
BufferedWriter logout = new BufferedWriter(new FileWriter(mDumpPath + ".log"));
+ SimpleDateFormat timeformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.GERMAN);
for(LogItem li :OpenVPN.getlogbuffer()){
- logout.write(li.getString(null) + "\n");
+ String time = timeformat.format(new Date(li.getLogtime()));
+ logout.write(time +" " + li.getString(null) + "\n");
}
logout.close();
OpenVPN.logError(R.string.minidump_generated);
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java
index 7e1eebd3..cacbb85e 100644
--- a/src/de/blinkt/openvpn/OpenVpnService.java
+++ b/src/de/blinkt/openvpn/OpenVpnService.java
@@ -338,23 +338,6 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
}
private OpenVPNMangement instantiateOpenVPN3Core() {
- //new OpenVPNThreadv3(this,mProfile);
- try {
- Class cl = Class.forName("Lde/blinkt/openvpn/OpenVPNThreadv3;");
- return (OpenVPNMangement) cl.getConstructor(OpenVpnService.class,VpnProfile.class).newInstance(this,mProfile);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
return null;
}