logd: use std::function and lambdas where appropriate

Test: logging unit tests
Change-Id: I7cfc63937b5dadb5547c4661ca2f5204d7b4a174
diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h
index 09efc51..eb41efb 100644
--- a/logd/LogBuffer.h
+++ b/logd/LogBuffer.h
@@ -115,8 +115,7 @@
     uint64_t flushTo(SocketClient* writer, uint64_t start,
                      pid_t* lastTid,  // &lastTid[LOG_ID_MAX] or nullptr
                      bool privileged, bool security,
-                     int (*filter)(const LogBufferElement* element, void* arg) = nullptr,
-                     void* arg = nullptr);
+                     const std::function<int(const LogBufferElement* element)>& filter);
 
     bool clear(log_id_t id, uid_t uid = AID_ROOT);
     unsigned long getSize(log_id_t id);