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

Commit fbb29ced authored by Shunkai Yao's avatar Shunkai Yao
Browse files

Improve effect AIDL HAL logging

Bug: 333407024
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ie983c4360488a6047bd284c20bf9899d38b4273e
parent 2222e7d5
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;                                                                       \
        }                                                                                     \