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

Commit e26729ae authored by Shunkai Yao's avatar Shunkai Yao Committed by Gerrit Code Review
Browse files

Merge "Improve effect AIDL HAL logging" into main

parents 61f9dd21 fbb29ced
Loading
Loading
Loading
Loading
+30 −30
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ inline std::ostream& operator<<(std::ostream& out, const RetCode& code) {
    do {                                                                                        \
        const ::ndk::ScopedAStatus curr_status = (status);                                      \
        if (!curr_status.isOk()) {                                                              \
            LOG(ERROR) << __func__ << ":" << __LINE__                                          \
            LOG(ERROR) << __func__ << ": line" << __LINE__                                      \
                       << " return with status: " << curr_status.getDescription() << (message); \
            return ndk::ScopedAStatus::fromExceptionCodeWithMessage(                            \
                    curr_status.getExceptionCode(), (message));                                 \
@@ -89,7 +89,7 @@ inline std::ostream& operator<<(std::ostream& out, const RetCode& code) {
#define RETURN_IF(expr, exception, message)                                                  \
    do {                                                                                     \
        if (expr) {                                                                          \
            LOG(ERROR) << __func__ << ":" << __LINE__ << " return with expr " << #expr;      \
            LOG(ERROR) << __func__ << ": line" << __LINE__ << " return with expr " << #expr; \
            return ndk::ScopedAStatus::fromExceptionCodeWithMessage((exception), (message)); \
        }                                                                                    \
    } while (0)
@@ -97,7 +97,7 @@ inline std::ostream& operator<<(std::ostream& out, const RetCode& code) {
#define RETURN_OK_IF(expr)                                                                  \
    do {                                                                                    \
        if (expr) {                                                                         \
            LOG(INFO) << __func__ << ":" << __LINE__ << " return with expr " << #expr; \
            LOG(INFO) << __func__ << ": line" << __LINE__ << " return with expr " << #expr; \
            return ndk::ScopedAStatus::ok();                                                \
        }                                                                                   \
    } while (0)
@@ -105,7 +105,7 @@ inline std::ostream& operator<<(std::ostream& out, const RetCode& code) {
#define RETURN_VALUE_IF(expr, ret, log)                                                       \
    do {                                                                                      \
        if (expr) {                                                                           \
            LOG(ERROR) << __func__ << ":" << __LINE__ << " return with expr \"" << #expr \
            LOG(ERROR) << __func__ << ": line" << __LINE__ << " return with expr \"" << #expr \
                       << "\":" << (log);                                                     \
            return ret;                                                                       \
        }                                                                                     \