logd: format LogBufferElement and LogStatistics correctly

Test: logging unit tests
Change-Id: If63be065e38f2a1c4cf2807ceaa9eea180b16c51
diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h
index 35252f9..5b13e32 100644
--- a/logd/LogBufferElement.h
+++ b/logd/LogBufferElement.h
@@ -33,26 +33,6 @@
 #define EXPIRE_RATELIMIT 10  // maximum rate in seconds to report expiration
 
 class __attribute__((packed)) LogBufferElement {
-    // sized to match reality of incoming log packets
-    const uint32_t mUid;
-    const uint32_t mPid;
-    const uint32_t mTid;
-    uint64_t mSequence;
-    log_time mRealTime;
-    union {
-        char* mMsg;    // mDropped == false
-        int32_t mTag;  // mDropped == true
-    };
-    union {
-        const uint16_t mMsgLen;  // mDropped == false
-        uint16_t mDroppedCount;  // mDropped == true
-    };
-    const uint8_t mLogId;
-    bool mDropped;
-
-    // assumption: mDropped == true
-    size_t populateDroppedMessage(char*& buffer, LogStatistics* parent, bool lastSame);
-
   public:
     LogBufferElement(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid,
                      uint64_t sequence, const char* msg, uint16_t len);
@@ -60,37 +40,41 @@
     LogBufferElement(LogBufferElement&& elem);
     ~LogBufferElement();
 
-    bool isBinary(void) const {
-        return (mLogId == LOG_ID_EVENTS) || (mLogId == LOG_ID_SECURITY);
-    }
+    bool IsBinary() const { return (log_id_ == LOG_ID_EVENTS) || (log_id_ == LOG_ID_SECURITY); }
 
-    log_id_t getLogId() const {
-        return static_cast<log_id_t>(mLogId);
-    }
-    uid_t getUid(void) const {
-        return mUid;
-    }
-    pid_t getPid(void) const {
-        return mPid;
-    }
-    pid_t getTid(void) const {
-        return mTid;
-    }
-    uint32_t getTag() const;
-    uint16_t getDropped(void) const {
-        return mDropped ? mDroppedCount : 0;
-    }
-    uint16_t setDropped(uint16_t value);
-    uint16_t getMsgLen() const {
-        return mDropped ? 0 : mMsgLen;
-    }
-    const char* getMsg() const {
-        return mDropped ? nullptr : mMsg;
-    }
-    uint64_t getSequence() const { return mSequence; }
-    log_time getRealTime(void) const {
-        return mRealTime;
-    }
+    uint32_t GetTag() const;
+    uint16_t SetDropped(uint16_t value);
 
     bool FlushTo(LogWriter* writer, LogStatistics* parent, bool lastSame);
+
+    log_id_t log_id() const { return static_cast<log_id_t>(log_id_); }
+    uid_t uid() const { return uid_; }
+    pid_t pid() const { return pid_; }
+    pid_t tid() const { return tid_; }
+    uint16_t msg_len() const { return dropped_ ? 0 : msg_len_; }
+    const char* msg() const { return dropped_ ? nullptr : msg_; }
+    uint64_t sequence() const { return sequence_; }
+    log_time realtime() const { return realtime_; }
+    uint16_t dropped_count() const { return dropped_ ? dropped_count_ : 0; }
+
+  private:
+    // assumption: mDropped == true
+    size_t PopulateDroppedMessage(char*& buffer, LogStatistics* parent, bool lastSame);
+
+    // sized to match reality of incoming log packets
+    const uint32_t uid_;
+    const uint32_t pid_;
+    const uint32_t tid_;
+    uint64_t sequence_;
+    log_time realtime_;
+    union {
+        char* msg_;    // mDropped == false
+        int32_t tag_;  // mDropped == true
+    };
+    union {
+        const uint16_t msg_len_;  // mDropped == false
+        uint16_t dropped_count_;  // mDropped == true
+    };
+    const uint8_t log_id_;
+    bool dropped_;
 };