diff --git a/docs/guide/monitoring/logging.md b/docs/guide/monitoring/logging.md index 24852d256..664db325f 100644 --- a/docs/guide/monitoring/logging.md +++ b/docs/guide/monitoring/logging.md @@ -44,15 +44,13 @@ try { ### Configuring Logging Behavior -You can configure various aspects of the logging system: +Thread IDs are included in log messages by default. You can configure the output +severity and enable timestamps: ```java // Configure logging to debug output with minimum severity level Logging.logToDebug(Logging.Severity.INFO); -// Enable/disable thread ID in log messages -Logging.logThreads(true); - // Enable/disable timestamps in log messages Logging.logTimestamps(true); ``` @@ -132,4 +130,4 @@ Logging.addLogSink(Logging.Severity.VERBOSE, new Slf4jLogSink()); This approach allows you to integrate WebRTC's native logging with your application's existing logging infrastructure. ## Conclusion -By using the provided methods and custom log sinks, you can effectively capture, process, and manage log messages to aid in debugging and monitoring your application. Whether you choose to use the native logging capabilities or integrate with existing logging frameworks, the WebRTC logging system is designed to be adaptable to your needs. \ No newline at end of file +By using the provided methods and custom log sinks, you can effectively capture, process, and manage log messages to aid in debugging and monitoring your application. Whether you choose to use the native logging capabilities or integrate with existing logging frameworks, the WebRTC logging system is designed to be adaptable to your needs. diff --git a/webrtc-jni/src/main/cpp/include/JNI_Logging.h b/webrtc-jni/src/main/cpp/include/JNI_Logging.h index 2360e1142..e15bf36cb 100644 --- a/webrtc-jni/src/main/cpp/include/JNI_Logging.h +++ b/webrtc-jni/src/main/cpp/include/JNI_Logging.h @@ -31,14 +31,6 @@ extern "C" { JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logToDebug (JNIEnv *, jclass, jobject); - /* - * Class: dev_onvoid_webrtc_logging_Logging - * Method: logThreads - * Signature: (Z)V - */ - JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logThreads - (JNIEnv *, jclass, jboolean); - /* * Class: dev_onvoid_webrtc_logging_Logging * Method: logTimestamps diff --git a/webrtc-jni/src/main/cpp/src/JNI_Logging.cpp b/webrtc-jni/src/main/cpp/src/JNI_Logging.cpp index ff2252e65..3d44fad3d 100644 --- a/webrtc-jni/src/main/cpp/src/JNI_Logging.cpp +++ b/webrtc-jni/src/main/cpp/src/JNI_Logging.cpp @@ -103,14 +103,8 @@ JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logToDebug } } -JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logThreads -(JNIEnv * env, jclass caller, jboolean enable) -{ - webrtc::LogMessage::LogThreads(static_cast(enable)); -} - JNIEXPORT void JNICALL Java_dev_onvoid_webrtc_logging_Logging_logTimestamps (JNIEnv * env, jclass caller, jboolean enable) { webrtc::LogMessage::LogTimestamps(static_cast(enable)); -} \ No newline at end of file +} diff --git a/webrtc-jni/src/main/cpp/src/JNI_WebRTC.cpp b/webrtc-jni/src/main/cpp/src/JNI_WebRTC.cpp index b932822d7..54707fe2b 100644 --- a/webrtc-jni/src/main/cpp/src/JNI_WebRTC.cpp +++ b/webrtc-jni/src/main/cpp/src/JNI_WebRTC.cpp @@ -39,6 +39,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM * vm, void * reserved) // can log, so nothing is written unless the application asks for it through // Logging.logToDebug or a log sink. webrtc::LoggingConfig loggingConfig; + loggingConfig.set_log_thread(true); loggingConfig.set_min_severity(webrtc::LS_NONE); loggingConfig.set_debug_severity(webrtc::LS_NONE); webrtc::InitializeLogging(std::move(loggingConfig)); diff --git a/webrtc/src/main/java/dev/onvoid/webrtc/logging/Logging.java b/webrtc/src/main/java/dev/onvoid/webrtc/logging/Logging.java index d4e67327b..75b714adc 100644 --- a/webrtc/src/main/java/dev/onvoid/webrtc/logging/Logging.java +++ b/webrtc/src/main/java/dev/onvoid/webrtc/logging/Logging.java @@ -69,8 +69,6 @@ public enum Severity { public static native void logToDebug(Severity severity); - public static native void logThreads(boolean enable); - public static native void logTimestamps(boolean enable); public static void verbose(String message) { diff --git a/webrtc/src/test/java/dev/onvoid/webrtc/logging/LoggingTests.java b/webrtc/src/test/java/dev/onvoid/webrtc/logging/LoggingTests.java index 159206297..2b4ce369b 100644 --- a/webrtc/src/test/java/dev/onvoid/webrtc/logging/LoggingTests.java +++ b/webrtc/src/test/java/dev/onvoid/webrtc/logging/LoggingTests.java @@ -31,9 +31,8 @@ class LoggingTests { @Test void logToDebug() { - Logging.logToDebug(Severity.ERROR); - Logging.error("logToDebug at ERROR"); Logging.logToDebug(Severity.INFO); + Logging.info("logToDebug at INFO"); Logging.logToDebug(Severity.NONE); Logging.info("logToDebug at NONE must not print this"); }