Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
send ooni log to logcat
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Dec 10, 2015
1 parent d7eead5 commit dc7b130
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions jni/ooni_sync_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Measurement-kit is free software. See AUTHORS and LICENSE for more
// information on the copying conditions.

#include <android/log.h>
#include <jni.h>
#include <measurement_kit/ooni.hpp>
#include <string>
Expand All @@ -17,6 +18,10 @@ Java_io_github_measurement_1kit_jni_sync_OoniSyncApi_dnsInjection(
.set_backend(mk::jni::cxxstring(env, backend))
.set_input_file_path(mk::jni::cxxstring(env, inputPath))
.set_verbose(verbose)
.on_log([](const char *s) {
__android_log_print(ANDROID_LOG_INFO,
"dns-injection", "%s", s);
})
.run();
} catch (...) {
// XXX suppress
Expand All @@ -32,6 +37,10 @@ Java_io_github_measurement_1kit_jni_sync_OoniSyncApi_httpInvalidRequestLine(
mk::ooni::HttpInvalidRequestLineTest()
.set_backend(mk::jni::cxxstring(env, backend))
.set_verbose(verbose)
.on_log([](const char *s) {
__android_log_print(ANDROID_LOG_INFO,
"http-invalid-request-line", "%s", s);
})
.run();
} catch (...) {
// XXX suppress
Expand All @@ -48,6 +57,10 @@ Java_io_github_measurement_1kit_jni_sync_OoniSyncApi_tcpConnect(
.set_port(mk::jni::cxxstring(env, port))
.set_input_file_path(mk::jni::cxxstring(env, inputPath))
.set_verbose(verbose)
.on_log([](const char *s) {
__android_log_print(ANDROID_LOG_INFO,
"tcp-connect", "%s", s);
})
.run();
} catch (...) {
// XXX suppress
Expand Down

0 comments on commit dc7b130

Please sign in to comment.