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

Commit f172fc57 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "libmediadrm: visually highlight exception log msg" into sc-dev

parents df33f454 d5c3961b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -326,6 +326,9 @@ char logPriorityToChar(::V1_4::LogPriority priority) {

std::string GetExceptionMessage(status_t err, const char *msg,
                                const Vector<::V1_4::LogMessage> &logs) {
    std::string ruler("==============================");
    std::string header("Beginning of DRM Plugin Log");
    std::string footer("End of DRM Plugin Log");
    String8 msg8;
    if (msg) {
        msg8 += msg;
@@ -333,6 +336,7 @@ std::string GetExceptionMessage(status_t err, const char *msg,
    }
    auto errStr = StrCryptoError(err);
    msg8 += errStr.c_str();
    msg8 += String8::format("\n%s %s %s", ruler.c_str(), header.c_str(), ruler.c_str());

    for (auto log : logs) {
        time_t seconds = log.timeMs / 1000;
@@ -347,6 +351,7 @@ std::string GetExceptionMessage(status_t err, const char *msg,
        msg8 += String8::format("\n  %s.%03d %c %s", timeStr.c_str(), ms, p, log.message.c_str());
    }

    msg8 += String8::format("\n%s %s %s", ruler.c_str(), footer.c_str(), ruler.c_str());
    return msg8.c_str();
}