Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b88766a authored by Stefan Sauer's avatar Stefan Sauer Committed by ChromeOS Commit Bot
Browse files

metrics: tell what file we can't open on error

Use PDLOG and also log the filename.

BUG=chromium:467586
TEST=rebuild image and checked the log

Change-Id: I72f9838477adad71e79cc25f1f3a40bb9781b848
Reviewed-on: https://chromium-review.googlesource.com/260261


Tested-by: default avatarStefan Sauer <ensonic@google.com>
Reviewed-by: default avatarBertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Stefan Sauer <ensonic@google.com>
parent 5672f8b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample,
                                      READ_WRITE_ALL_FILE_FLAGS));

  if (file_descriptor.get() < 0) {
    DLOG(ERROR) << "error opening the file";
    DPLOG(ERROR) << filename << ": cannot open";
    return false;
  }

@@ -183,7 +183,7 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample,
  // underneath us. Keep the file locked as briefly as possible.
  // Freeing file_descriptor will close the file and and remove the lock.
  if (HANDLE_EINTR(flock(file_descriptor.get(), LOCK_EX)) < 0) {
    DLOG(ERROR) << "error locking" << filename << " : " << errno;
    DPLOG(ERROR) << filename << ": cannot lock";
    return false;
  }