Revert "Reland "Injectable logging""
This reverts commit 21219a0e43446701810236fb9fdd59be072c12df. Reason for revert: No tags are written when routing logs to a file - b/86953692 Original change's description: > Reland "Injectable logging" > > Any injected loggable or NativeLogger would be deleted if PCFactory > was reinitialized without calling setInjectableLogger. Now native > logging is not implemented as a Loggable, so it will remain active > unless a Loggable is injected. > > This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f > > 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} > > Bug: webrtc:9225 > Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee > TBR: kwiberg > Reviewed-on: https://webrtc-review.googlesource.com/77140 > Commit-Queue: Paulina Hensman <phensman@webrtc.org> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23310} TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:9225 Change-Id: I4d0a5990b5f742cc1a96afde3ca97fad9143d2d4 Reviewed-on: https://webrtc-review.googlesource.com/80641 Reviewed-by: Alex Glaznev <glaznev@webrtc.org> Commit-Queue: Alex Glaznev <glaznev@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23498}
This commit is contained in:
@ -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;
|
||||
|
||||
@ -42,20 +41,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) {
|
||||
@ -68,8 +62,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;
|
||||
@ -95,16 +87,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -214,16 +199,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.d(TAG,
|
||||
"PeerConnectionFactory was initialized without an injected Loggable. "
|
||||
+ "Any existing Loggable will be deleted.");
|
||||
Logging.deleteInjectedLoggable();
|
||||
nativeDeleteLoggable();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkInitializeHasBeenCalled() {
|
||||
@ -499,6 +474,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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user