23 void StopSendingLogs();
25 void OnLog(
const std::string& log_level,
26 const std::string& message,
27 const std::string& filename,
28 const std::string& function,
31 void OnLogs(std::vector<SdkLog> sdkLogs)
override;
33 virtual std::future<bool> SendSDKLogAsync(
const analytics::SDKLogsPayload& payload) = 0;
36 static constexpr size_t kMaxBufferSize = 50;
37 static constexpr int kFlushIntervalSeconds = 5;
38 std::string BuildLogMessage(
const std::string& level,
39 const std::string& message,
40 const std::string& filename,
41 const std::string& function,
47 std::vector<analytics::SDKLogsPayload::SDKLog> buffer_;
48 std::mutex buffer_mtx_;
49 std::condition_variable cv_;
50 std::thread flush_thread_;
51 std::atomic<bool> stop_thread_ =
false;
52 std::atomic<bool> is_sending_thread_stopped_ =
false;