aboutsummaryrefslogtreecommitdiff
path: root/res_stats.cpp
diff options
context:
space:
mode:
authorKen Chen <cken@google.com>2019-03-19 17:41:28 +0800
committerKen Chen <cken@google.com>2019-03-21 17:12:48 +0800
commitffc224aae14c52e27005bb35d4113f76a60f89eb (patch)
tree27c453f65e627e26bbc151c66b5008e4509b0a73 /res_stats.cpp
parent36796f35666cf53dc537112d711e9f52122781ec (diff)
downloadDnsResolver-ffc224aae14c52e27005bb35d4113f76a60f89eb.tar.gz
Disable sensitive logs
- PII logs can only appear in VERBOSE level - logSeverityStrToEnum() no more support VERBOSE level input, only accept DEBUG, INFO, WARNING, and ERROR. - developer can set DBG flag from code to have a debug build, the DEBUG level is automatically promote to VERBOSE. - uniform log format to [FILE NAME]: [FUNC NAME]: [MSG] - move from ALOG to LOG on DnsProxyListener - adjust severity for some logs - correct print format on uint8_t type Bug: 128736560 Test: builds, boots Test: atest resolv_integration_test Change-Id: I0ff03824901168165bbe1f5abae9ff3e74db63d6
Diffstat (limited to 'res_stats.cpp')
-rw-r--r--res_stats.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/res_stats.cpp b/res_stats.cpp
index cfc5e6f4..cf649498 100644
--- a/res_stats.cpp
+++ b/res_stats.cpp
@@ -120,22 +120,22 @@ static bool res_stats_usable_server(const res_params* params, res_stats* stats)
&rtt_avg, &last_sample_time);
if (successes >= 0 && errors >= 0 && timeouts >= 0) {
int total = successes + errors + timeouts;
- LOG(INFO) << "NS stats: S " << successes << " + E " << errors << " + T " << timeouts
- << " + I " << internal_errors << " = " << total << ", rtt = " << rtt_avg
- << ", min_samples = " << params->min_samples;
+ LOG(INFO) << __func__ << ": NS stats: S " << successes << " + E " << errors << " + T "
+ << timeouts << " + I " << internal_errors << " = " << total
+ << ", rtt = " << rtt_avg << ", min_samples = " << unsigned(params->min_samples);
if (total >= params->min_samples && (errors > 0 || timeouts > 0)) {
int success_rate = successes * 100 / total;
- LOG(INFO) << "success rate " << success_rate;
+ LOG(INFO) << __func__ << ": success rate " << success_rate;
if (success_rate < params->success_threshold) {
time_t now = time(NULL);
if (now - last_sample_time > params->sample_validity) {
// Note: It might be worth considering to expire old servers after their expiry
// date has been reached, however the code for returning the ring buffer to its
// previous non-circular state would induce additional complexity.
- LOG(INFO) << "samples stale, retrying server";
+ LOG(INFO) << __func__ << ": samples stale, retrying server";
_res_stats_clear_samples(stats);
} else {
- LOG(INFO) << "too many resolution errors, ignoring server";
+ LOG(INFO) << __func__ << ": too many resolution errors, ignoring server";
return 0;
}
}