Delete log severity LS_SENSITIVE

Bug: webrtc:10026
Change-Id: Ic23cd6fe6df047fd0498cb0699176b447f1d7bc6
Reviewed-on: https://webrtc-review.googlesource.com/c/111581
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26011}
This commit is contained in:
Niels Möller 2018-11-21 09:34:11 +01:00 committed by Commit Bot
parent 5301951b65
commit 25aefd3584
8 changed files with 9 additions and 33 deletions

View file

@ -88,7 +88,7 @@ public class Logging {
}
// Keep in sync with webrtc/rtc_base/logging.h:LoggingSeverity.
public enum Severity { LS_SENSITIVE, LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR, LS_NONE }
public enum Severity { LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR, LS_NONE }
public static void enableLogThreads() {
nativeEnableLogThreads();

View file

@ -308,8 +308,6 @@ void LogMessage::ConfigureLogging(const char* params) {
LogThreads();
// Logging levels
} else if (token == "sensitive") {
current_level = LS_SENSITIVE;
} else if (token == "verbose") {
current_level = LS_VERBOSE;
} else if (token == "info") {
@ -402,13 +400,6 @@ void LogMessage::OutputToDebug(const std::string& str,
// from the shell.
int prio;
switch (severity) {
case LS_SENSITIVE:
__android_log_write(ANDROID_LOG_INFO, tag, "SENSITIVE");
if (log_to_stderr) {
fprintf(stderr, "SENSITIVE");
fflush(stderr);
}
return;
case LS_VERBOSE:
prio = ANDROID_LOG_VERBOSE;
break;

View file

@ -73,8 +73,6 @@ namespace rtc {
// Note that the non-standard LoggingSeverity aliases exist because they are
// still in broad use. The meanings of the levels are:
// LS_SENSITIVE: Information which should only be logged with the consent
// of the user, due to privacy concerns.
// LS_VERBOSE: This level is for data which we do not want to appear in the
// normal debug log, but should appear in diagnostic logs.
// LS_INFO: Chatty level used in debugging for all sorts of things, the default
@ -83,7 +81,6 @@ namespace rtc {
// LS_ERROR: Something that should not have occurred.
// LS_NONE: Don't log.
enum LoggingSeverity {
LS_SENSITIVE,
LS_VERBOSE,
LS_INFO,
LS_WARNING,

View file

@ -288,10 +288,7 @@ class LogThread {
void Start() { thread_.Start(); }
private:
void Run() {
// LS_SENSITIVE by default to avoid cluttering up any real logging going on.
RTC_LOG(LS_SENSITIVE) << "RTC_LOG";
}
void Run() { RTC_LOG(LS_VERBOSE) << "RTC_LOG"; }
static void ThreadEntry(void* p) { static_cast<LogThread*>(p)->Run(); }
@ -312,9 +309,9 @@ TEST(LogTest, MultipleThreads) {
std::string s1, s2, s3;
LogSinkImpl<StringStream> stream1(&s1), stream2(&s2), stream3(&s3);
for (int i = 0; i < 1000; ++i) {
LogMessage::AddLogToStream(&stream1, LS_INFO);
LogMessage::AddLogToStream(&stream2, LS_VERBOSE);
LogMessage::AddLogToStream(&stream3, LS_SENSITIVE);
LogMessage::AddLogToStream(&stream1, LS_WARNING);
LogMessage::AddLogToStream(&stream2, LS_INFO);
LogMessage::AddLogToStream(&stream3, LS_VERBOSE);
LogMessage::RemoveLogToStream(&stream1);
LogMessage::RemoveLogToStream(&stream2);
LogMessage::RemoveLogToStream(&stream3);
@ -371,12 +368,10 @@ TEST(LogTest, CheckTagAddedToStringInDefaultOnLogMessageAndroid) {
TEST(LogTest, Perf) {
std::string str;
LogSinkImpl<StringStream> stream(&str);
LogMessage::AddLogToStream(&stream, LS_SENSITIVE);
LogMessage::AddLogToStream(&stream, LS_VERBOSE);
const std::string message(80, 'X');
{
LogMessageForTesting sanity_check_msg(__FILE__, __LINE__, LS_SENSITIVE);
}
{ LogMessageForTesting sanity_check_msg(__FILE__, __LINE__, LS_VERBOSE); }
// We now know how many bytes the logging framework will tag onto every msg.
const size_t logging_overhead = str.size();
@ -387,7 +382,7 @@ TEST(LogTest, Perf) {
int64_t start = TimeMillis(), finish;
for (int i = 0; i < kRepetitions; ++i) {
LogMessageForTesting(__FILE__, __LINE__, LS_SENSITIVE).stream() << message;
LogMessageForTesting(__FILE__, __LINE__, LS_VERBOSE).stream() << message;
}
finish = TimeMillis();

View file

@ -22,7 +22,7 @@ JNI_FUNCTION_DECLARATION(void,
JNIEnv* jni,
jclass,
jint nativeSeverity) {
if (nativeSeverity >= rtc::LS_SENSITIVE && nativeSeverity <= rtc::LS_NONE) {
if (nativeSeverity >= rtc::LS_VERBOSE && nativeSeverity <= rtc::LS_NONE) {
rtc::LogMessage::LogToDebug(
static_cast<rtc::LoggingSeverity>(nativeSeverity));
}

View file

@ -48,8 +48,6 @@ class CallbackWithSeverityLogSink : public rtc::LogSink {
private:
static RTCLoggingSeverity NativeSeverityToObjcSeverity(rtc::LoggingSeverity severity) {
switch (severity) {
case rtc::LS_SENSITIVE:
return RTCLoggingSeveritySensitive;
case rtc::LS_VERBOSE:
return RTCLoggingSeverityVerbose;
case rtc::LS_INFO:
@ -122,8 +120,6 @@ class CallbackWithSeverityLogSink : public rtc::LogSink {
- (rtc::LoggingSeverity)rtcSeverity {
switch (_severity) {
case RTCLoggingSeveritySensitive:
return rtc::LS_SENSITIVE;
case RTCLoggingSeverityVerbose:
return rtc::LS_VERBOSE;
case RTCLoggingSeverityInfo:

View file

@ -14,7 +14,6 @@
// Subset of rtc::LoggingSeverity.
typedef NS_ENUM(NSInteger, RTCLoggingSeverity) {
RTCLoggingSeveritySensitive,
RTCLoggingSeverityVerbose,
RTCLoggingSeverityInfo,
RTCLoggingSeverityWarning,

View file

@ -14,8 +14,6 @@
rtc::LoggingSeverity RTCGetNativeLoggingSeverity(RTCLoggingSeverity severity) {
switch (severity) {
case RTCLoggingSeveritySensitive:
return rtc::LS_SENSITIVE;
case RTCLoggingSeverityVerbose:
return rtc::LS_VERBOSE;
case RTCLoggingSeverityInfo: