diff --git a/metrics/metrics_daemon.cc b/metrics/metrics_daemon.cc index 47d74fa98..d1eb25e60 100644 --- a/metrics/metrics_daemon.cc +++ b/metrics/metrics_daemon.cc @@ -928,8 +928,6 @@ void MetricsDaemon::ReportDailyUse(int use_seconds) { void MetricsDaemon::SendSample(const string& name, int sample, int min, int max, int nbuckets) { - DLOG(INFO) << "received metric: " << name << " " << sample << " " - << min << " " << max << " " << nbuckets; metrics_lib_->SendToUMA(name, sample, min, max, nbuckets); } @@ -993,8 +991,6 @@ void MetricsDaemon::SendCrashFrequencySample( void MetricsDaemon::SendLinearSample(const string& name, int sample, int max, int nbuckets) { - DLOG(INFO) << "received linear metric: " << name << " " << sample << " " - << max << " " << nbuckets; // TODO(semenzato): add a proper linear histogram to the Chrome external // metrics API. LOG_IF(FATAL, nbuckets != max + 1) << "unsupported histogram scale"; diff --git a/metrics/metrics_daemon_main.cc b/metrics/metrics_daemon_main.cc index 5fb7507e7..ffe74f2a7 100644 --- a/metrics/metrics_daemon_main.cc +++ b/metrics/metrics_daemon_main.cc @@ -3,8 +3,10 @@ // found in the LICENSE file. +#include #include #include +#include #include #include @@ -43,7 +45,13 @@ const std::string MetricsMainDiskStatsPath() { } int main(int argc, char** argv) { + CommandLine::Init(argc, argv); google::ParseCommandLineFlags(&argc, &argv, true); + + // Also log to stderr when not running as daemon. + chromeos::InitLog(chromeos::kLogToSyslog | chromeos::kLogHeader | + (FLAGS_daemon ? 0 : chromeos::kLogToStderr)); + MetricsLibrary metrics_lib; metrics_lib.Init(); MetricsDaemon daemon;