From d5d16942965234d0bbf1a85d964cd3a26cffa4a2 Mon Sep 17 00:00:00 2001 From: Leonid Ryzhyk Date: Mon, 8 Jul 2019 10:34:50 -0700 Subject: [PATCH] java/ddlogapi.c: better document `ddlog_log_replace_callback` --- java/ddlogapi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/ddlogapi.c b/java/ddlogapi.c index 2d2551d25..60ac476d1 100644 --- a/java/ddlogapi.c +++ b/java/ddlogapi.c @@ -75,8 +75,6 @@ static struct CallbackInfo* createCallback(JNIEnv* env, jobject obj, jstring met return cbinfo; } - - static void deleteCallback(struct CallbackInfo* cbinfo) { if (cbinfo == NULL) return; @@ -282,6 +280,9 @@ void log_callback(uintptr_t callbackInfo, int level, const char *msg) { /* This function sets up a new logging callback for the given module and * then deallocates the old `CallbackInfo`, if any. + * + * Returns 0 if either `callback` is NULL or `callback` is not NULL and + * installing the new callback fails. */ JNIEXPORT jlong JNICALL Java_ddlogapi_DDlogAPI_ddlog_1log_1replace_1callback( JNIEnv *env, jobject obj, jint module, jlong old_cbinfo, jobject callback, jint max_level) {