Report connections

This commit is contained in:
M66B
2021-10-20 20:53:09 +02:00
parent ca2d0f7d60
commit 1c8e16f794
5 changed files with 15 additions and 6 deletions

View File

@@ -28,8 +28,16 @@ public class TrafficStatsHelper {
ctx = context;
}
public static void report(String host, String protocol, long sent, long received) {
String msg = protocol + " " + host + " tx=" + sent + " rx=" + received;
public static void connect(String host, int port, String prefix) {
String msg = "Connected " + prefix + " " + host + ":" + port;
if (ctx == null)
Log.i(msg);
else
EntityLog.log(ctx, EntityLog.Type.Statistics, msg);
}
public static void report(String host, String prefix, long sent, long received) {
String msg = "Disconnected " + prefix + " " + host + " tx=" + sent + " rx=" + received;
if (ctx == null)
Log.i(msg);
else