Revert "Reland "Remove WEBRTC_TRACE.""

This reverts commit 68007e97ec9399125e4be9964af8b0338766cd91.

Reason for revert: More downstream breakages.

Original change's description:
> Reland "Remove WEBRTC_TRACE."
> 
> This is a reland of 2209b90449473e1df3e0797b6271c7624b41907d
> Original change's description:
> > Remove WEBRTC_TRACE.
> > 
> > Bug: webrtc:5118
> > Change-Id: I0af0f8845ee016fa61d7cecc526e2a672ec8732d
> > Reviewed-on: https://webrtc-review.googlesource.com/5382
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#20114}
> 
> Bug: webrtc:5118
> Change-Id: I2d93fd40fcaa251c363bdcfb1c04b834a3a7f0e9
> Reviewed-on: https://webrtc-review.googlesource.com/6000
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#20132}

TBR=solenberg@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,nisse@webrtc.org

Change-Id: I093ee8c5c997c0dd46b3a3ca0e6271e3ea083d82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:5118
Reviewed-on: https://webrtc-review.googlesource.com/6320
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20133}
This commit is contained in:
Fredrik Solenberg
2017-10-04 08:49:37 +00:00
committed by Commit Bot
parent 68007e97ec
commit 39cefdb3c5
36 changed files with 1589 additions and 15 deletions

View File

@ -22,6 +22,7 @@ import java.util.logging.Logger;
* app:
* - Logging.enableLogThreads
* - Logging.enableLogTimeStamps
* - Logging.enableTracing
* - Logging.enableLogToDebugOutput
*
* Using these APIs requires that the native library is loaded. For example:
@ -33,6 +34,7 @@ import java.util.logging.Logger;
*/
public class Logging {
private static final Logger fallbackLogger = createFallbackLogger();
private static volatile boolean tracingEnabled;
private static volatile boolean loggingEnabled;
private static Logger createFallbackLogger() {
@ -41,8 +43,7 @@ public class Logging {
return fallbackLogger;
}
// TODO(solenberg): Remove once dependent projects updated.
@Deprecated
// Keep in sync with webrtc/common_types.h:TraceLevel.
public enum TraceLevel {
TRACE_NONE(0x0000),
TRACE_STATEINFO(0x0001),
@ -77,9 +78,19 @@ public class Logging {
nativeEnableLogTimeStamps();
}
// TODO(solenberg): Remove once dependent projects updated.
@Deprecated
public static void enableTracing(String path, EnumSet<TraceLevel> levels) {
// Enable tracing to |path| of messages of |levels|.
// On Android, use "logcat:" for |path| to send output there.
// Note: this function controls the output of the WEBRTC_TRACE() macros.
public static synchronized void enableTracing(String path, EnumSet<TraceLevel> levels) {
if (tracingEnabled) {
return;
}
int nativeLevel = 0;
for (TraceLevel level : levels) {
nativeLevel |= level.level;
}
nativeEnableTracing(path, nativeLevel);
tracingEnabled = true;
}
// Enable diagnostic logging for messages of |severity| to the platform debug
@ -154,6 +165,7 @@ public class Logging {
return sw.toString();
}
private static native void nativeEnableTracing(String path, int nativeLevels);
private static native void nativeEnableLogToDebugOutput(int nativeSeverity);
private static native void nativeEnableLogThreads();
private static native void nativeEnableLogTimeStamps();