diff options
author | cyBerta <cyberta@riseup.net> | 2022-06-27 23:09:04 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2022-07-19 00:03:57 +0200 |
commit | c0b1e3148dbc26417df21e90ab8e7d8338c7240a (patch) | |
tree | 3e0052f301fdd3d0a9f52cd083a26fa4553912b9 /app/src | |
parent | 5afdb3d3ed61efd547b3756e5c1c4f119e126500 (diff) |
define logging interface for obfsvpn
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java index 635f795d..5b8b7326 100644 --- a/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java +++ b/app/src/main/java/se/leap/bitmaskclient/pluggableTransports/ObfsVpnClient.java @@ -8,9 +8,10 @@ import java.util.concurrent.atomic.AtomicBoolean; import client.Client_; import de.blinkt.openvpn.core.ConnectionStatus; +import de.blinkt.openvpn.core.VpnStatus; import se.leap.bitmaskclient.eip.EipStatus; -public class ObfsVpnClient implements Observer { +public class ObfsVpnClient implements Observer, client.EventLogger { public static final String SOCKS_PORT = "4430"; public static final String SOCKS_IP = "127.0.0.1"; @@ -25,6 +26,7 @@ public class ObfsVpnClient implements Observer { public ObfsVpnClient(Obfs4Options options) { obfsVpnClient = new Client_(options.udp, SOCKS_IP+":"+SOCKS_PORT, options.cert); + obfsVpnClient.setEventLogger(this); } public void start() { @@ -35,6 +37,7 @@ public class ObfsVpnClient implements Observer { obfsVpnClient.start(); } catch (Exception e) { e.printStackTrace(); + VpnStatus.logError("[obfsvpn] " + e.getLocalizedMessage()); if (noNetwork) { isErrorHandling.set(true); } @@ -85,4 +88,15 @@ public class ObfsVpnClient implements Observer { } } } + + @Override + public void error(String s) { + VpnStatus.logError("[obfsvpn] " + s); + } + + @Override + public void log(String state, String message) { + VpnStatus.logDebug("[obfsvpn] " + state + " " + message); + } + } |