diff --git a/java/rocksjni/loggerjnicallback.cc b/java/rocksjni/loggerjnicallback.cc index d92b17c22..539a76fbb 100644 --- a/java/rocksjni/loggerjnicallback.cc +++ b/java/rocksjni/loggerjnicallback.cc @@ -60,6 +60,9 @@ void LoggerJniCallback::Logv(const InfoLogLevel log_level, case rocksdb::InfoLogLevel::FATAL_LEVEL: jlog_level = InfoLogLevelJni::FATAL_LEVEL(env); break; + case rocksdb::InfoLogLevel::HEADER_LEVEL: + jlog_level = InfoLogLevelJni::HEADER_LEVEL(env); + break; default: jlog_level = InfoLogLevelJni::FATAL_LEVEL(env); break; diff --git a/java/rocksjni/portal.h b/java/rocksjni/portal.h index cc47367a7..4d7e50217 100644 --- a/java/rocksjni/portal.h +++ b/java/rocksjni/portal.h @@ -676,15 +676,20 @@ class InfoLogLevelJni { return getEnum(env, "FATAL_LEVEL"); } + // Get the HEADER_LEVEL enum field of org.rocksdb.InfoLogLevel + static jobject HEADER_LEVEL(JNIEnv* env) { + return getEnum(env, "HEADER_LEVEL"); + } + private: - // Get the java class id of org.rocksdb.WBWIRocksIterator.WriteType. + // Get the java class id of org.rocksdb.InfoLogLevel static jclass getJClass(JNIEnv* env) { jclass jclazz = env->FindClass("org/rocksdb/InfoLogLevel"); assert(jclazz != nullptr); return jclazz; } - // Get an enum field of org.rocksdb.WBWIRocksIterator.WriteType + // Get an enum field of org.rocksdb.InfoLogLevel static jobject getEnum(JNIEnv* env, const char name[]) { jclass jclazz = getJClass(env); jfieldID jfid = diff --git a/java/src/main/java/org/rocksdb/InfoLogLevel.java b/java/src/main/java/org/rocksdb/InfoLogLevel.java index e67063c68..971c0b2ec 100644 --- a/java/src/main/java/org/rocksdb/InfoLogLevel.java +++ b/java/src/main/java/org/rocksdb/InfoLogLevel.java @@ -9,7 +9,8 @@ public enum InfoLogLevel { WARN_LEVEL((byte)2), ERROR_LEVEL((byte)3), FATAL_LEVEL((byte)4), - NUM_INFO_LOG_LEVELS((byte)5); + HEADER_LEVEL((byte)5), + NUM_INFO_LOG_LEVELS((byte)6); private final byte value_;