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

Commit

Permalink
Merge branch 'feature/logger'
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Dec 9, 2015
2 parents d66d311 + 4567475 commit d3fecc2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ javah:
@echo "Creating header files in jni using $(JAVAH)..."
@cd jni && $(JAVAH) -cp ../java $(PACKAGE).sync.OoniSyncApi
@cd jni && $(JAVAH) -cp ../java $(PACKAGE).sync.PortolanSyncApi
@cd jni && $(JAVAH) -cp ../java $(PACKAGE).LoggerApi

jni-libs-no-unpack:
$(NDK_BUILD) NDK_LIBS_OUT=./jniLibs
Expand Down
22 changes: 22 additions & 0 deletions java/io/github/measurement_kit/jni/LoggerApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Part of measurement-kit <https://measurement-kit.github.io/>.
// Measurement-kit is free software. See AUTHORS and LICENSE for more
// information on the copying conditions.

package io.github.measurement_kit.jni;

/**
* Access to MeasurementKit Logger functionality
*/
public class LoggerApi {

/**
* Control verbosity of the default logger.
* @param verbose Make verbose if true, quiet if false.
*/
public static native void setVerbose(int verbose);

/**
* Redirect default logger's output to Android logcat.
*/
public static native void useAndroidLogger();
}
5 changes: 3 additions & 2 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog -latomic
LOCAL_STATIC_LIBRARIES := measurement_kit event event_pthreads jansson \
maxminddb yaml-cpp
maxminddb yaml-cpp
LOCAL_MODULE := measurement_kit_jni
LOCAL_SRC_FILES := common.cpp ooni_sync_api.cpp portolan_sync_api.cpp
LOCAL_SRC_FILES := common.cpp logger_api.cpp ooni_sync_api.cpp \
portolan_sync_api.cpp
APP_PLATFORM := android-21
LOCAL_CPPFLAGS += -I jni/$(TARGET_ARCH_ABI)/include -std=c++11
include $(BUILD_SHARED_LIBRARY)

0 comments on commit d3fecc2

Please sign in to comment.