Reduce LOG(ERROR) spam on linux with chromeos=1
LOG(ERROR) Spam makes failing tests more difficult to debug
and obscures actual errors. This cleans up some spam that
always shows up when running on Linux with chromeos=1.
BUG=none
Review URL: https://codereview.chromium.org/1254013002
Cr-Commit-Position: refs/heads/master@{#341145}
diff --git a/components/ownership/owner_key_util_impl.cc b/components/ownership/owner_key_util_impl.cc
index 6a95131..fdf29e9 100644
--- a/components/ownership/owner_key_util_impl.cc
+++ b/components/ownership/owner_key_util_impl.cc
@@ -4,12 +4,12 @@
#include "components/ownership/owner_key_util_impl.h"
+#include <keythi.h>
#include <limits>
#include "base/files/file_util.h"
#include "base/logging.h"
-
-#include <keythi.h>
+#include "base/sys_info.h"
#include "crypto/nss_key_util.h"
namespace ownership {
@@ -26,7 +26,8 @@
int64 file_size;
if (!base::GetFileSize(public_key_file_, &file_size)) {
#if defined(OS_CHROMEOS)
- LOG(ERROR) << "Could not get size of " << public_key_file_.value();
+ LOG_IF(ERROR, base::SysInfo::IsRunningOnChromeOS())
+ << "Could not get size of " << public_key_file_.value();
#endif // defined(OS_CHROMEOS)
return false;
}