David Ribeiro Alves has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/4927

Change subject: Add a macro to LOG and return on a non-OK status
......................................................................

Add a macro to LOG and return on a non-OK status

We often see the following pattern:

Status s = someOperation();

if (!s.ok()) {
  LOG(ERROR) << "A critical error occurred at blah. Status: " << s.ToString();
  return s;
}

This is cumbersome. This macro allows to do the same the following way:

RETURN_NOT_OK_LOG(ERROR, someOperation(), "A critical error occurred at blah.");

The macro also prints the status (though at the beggining of the message and not
at the end so that we can have arbirarily long debugging information but the
status is easy to find).

Change-Id: Ibb906e7240d7a289a7822444bc9cbf748a555efb
---
M src/kudu/util/status.h
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/27/4927/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4927
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb906e7240d7a289a7822444bc9cbf748a555efb
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>

Reply via email to