logging.h 791 B

123456789101112131415161718192021222324252627
  1. // Copyright 2017 The Chromium OS Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SRC_LOGGING_H_
  5. #define SRC_LOGGING_H_
  6. #include "base/check.h"
  7. #include "base/logging.h"
  8. #define TEST_AND_RETURN_FALSE(_x) \
  9. do { \
  10. if (!(_x)) { \
  11. LOG(ERROR) << #_x " failed."; \
  12. return false; \
  13. } \
  14. } while (0)
  15. #define TEST_AND_RETURN_VALUE(_x, _v) \
  16. do { \
  17. if (!(_x)) { \
  18. LOG(ERROR) << #_x " failed."; \
  19. return (_v); \
  20. } \
  21. } while (0)
  22. #endif // SRC_LOGGING_H_