logd: remove SocketClient from LogBuffer and LogBufferElement
In the future, we'll want to be able to write to outputs that are not
necessarily a libsysutils SocketClient, for example host tests of
LogBuffer. Therefore, we add a LogWriter class to be used instead of
SocketClient.
Test: logging unit tests
Change-Id: I4385be65e14e83a635691a7ba79e9bf060e49484
diff --git a/logd/ChattyLogBuffer.h b/logd/ChattyLogBuffer.h
index d9cd24f..29a421d 100644
--- a/logd/ChattyLogBuffer.h
+++ b/logd/ChattyLogBuffer.h
@@ -28,15 +28,15 @@
#include "LogBuffer.h"
#include "LogBufferElement.h"
+#include "LogReaderList.h"
+#include "LogReaderThread.h"
#include "LogStatistics.h"
#include "LogTags.h"
#include "LogWhiteBlackList.h"
+#include "LogWriter.h"
typedef std::list<LogBufferElement*> LogBufferElementCollection;
-class LogReaderList;
-class LogReaderThread;
-
class ChattyLogBuffer : public LogBuffer {
LogBufferElementCollection mLogElements;
pthread_rwlock_t mLogElementsLock;
@@ -63,7 +63,7 @@
int Log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid, const char* msg,
uint16_t len) override;
uint64_t FlushTo(
- SocketClient* writer, uint64_t start, pid_t* lastTid, bool privileged, bool security,
+ LogWriter* writer, uint64_t start, pid_t* lastTid,
const std::function<FlushToResult(const LogBufferElement* element)>& filter) override;
bool Clear(log_id_t id, uid_t uid = AID_ROOT) override;