Revert "Injectable logging"

This reverts commit 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f.

Reason for revert:  forces all logs to have identical tag

Original change's description:
> Injectable logging
> 
> Allows passing a Loggable to PCFactory.initializationOptions, which
> is then injected to Logging.java and logging.h. Future log messages
> in both Java and native will then be passed to this Loggable.
> 
> Bug: webrtc:9225
> Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> Reviewed-on: https://webrtc-review.googlesource.com/73243
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23241}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org

Change-Id: I27c9587238325b69b26166434740869021b7db8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9225
Reviewed-on: https://webrtc-review.googlesource.com/76885
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23253}
This commit is contained in:
Alex Glaznev
2018-05-15 22:30:06 +00:00
committed by Commit Bot
parent d7624f2d90
commit 4f81038a52
16 changed files with 70 additions and 390 deletions

View File

@ -13,7 +13,6 @@ package org.webrtc;
import android.content.Context;
import java.util.List;
import javax.annotation.Nullable;
import org.webrtc.Logging.Severity;
import org.webrtc.audio.AudioDeviceModule;
import org.webrtc.audio.LegacyAudioDeviceModule;
@ -43,20 +42,15 @@ public class PeerConnectionFactory {
final boolean enableInternalTracer;
final boolean enableVideoHwAcceleration;
final NativeLibraryLoader nativeLibraryLoader;
@Nullable Loggable loggable;
@Nullable Severity loggableSeverity;
private InitializationOptions(Context applicationContext, String fieldTrials,
boolean enableInternalTracer, boolean enableVideoHwAcceleration,
NativeLibraryLoader nativeLibraryLoader, @Nullable Loggable loggable,
@Nullable Severity loggableSeverity) {
NativeLibraryLoader nativeLibraryLoader) {
this.applicationContext = applicationContext;
this.fieldTrials = fieldTrials;
this.enableInternalTracer = enableInternalTracer;
this.enableVideoHwAcceleration = enableVideoHwAcceleration;
this.nativeLibraryLoader = nativeLibraryLoader;
this.loggable = loggable;
this.loggableSeverity = loggableSeverity;
}
public static Builder builder(Context applicationContext) {
@ -69,8 +63,6 @@ public class PeerConnectionFactory {
private boolean enableInternalTracer = false;
private boolean enableVideoHwAcceleration = true;
private NativeLibraryLoader nativeLibraryLoader = new NativeLibrary.DefaultLoader();
@Nullable private Loggable loggable = null;
@Nullable private Severity loggableSeverity = null;
Builder(Context applicationContext) {
this.applicationContext = applicationContext;
@ -96,16 +88,9 @@ public class PeerConnectionFactory {
return this;
}
public Builder setInjectableLogger(Loggable loggable, Severity severity) {
this.loggable = loggable;
this.loggableSeverity = severity;
return this;
}
public PeerConnectionFactory.InitializationOptions createInitializationOptions() {
return new PeerConnectionFactory.InitializationOptions(applicationContext, fieldTrials,
enableInternalTracer, enableVideoHwAcceleration, nativeLibraryLoader, loggable,
loggableSeverity);
enableInternalTracer, enableVideoHwAcceleration, nativeLibraryLoader);
}
}
}
@ -215,13 +200,6 @@ public class PeerConnectionFactory {
if (options.enableInternalTracer && !internalTracerInitialized) {
initializeInternalTracer();
}
if (options.loggable != null) {
Logging.injectLoggable(options.loggable, options.loggableSeverity);
nativeInjectLoggable(new JNILogging(options.loggable), options.loggableSeverity.ordinal());
} else {
Logging.deleteInjectedLoggable();
nativeDeleteLoggable();
}
}
private void checkInitializeHasBeenCalled() {
@ -497,6 +475,4 @@ public class PeerConnectionFactory {
private static native void nativeInvokeThreadsCallbacks(long factory);
private static native void nativeFreeFactory(long factory);
private static native long nativeGetNativePeerConnectionFactory(long factory);
private static native void nativeInjectLoggable(JNILogging jniLogging, int severity);
private static native void nativeDeleteLoggable();
}