#include <log_state.h>
|
| LogState () |
|
const zx::socket & | socket () const |
|
std::shared_ptr< const std::vector< std::string > > | tags () const |
|
fidl::ClientEnd<::fuchsia_logger::LogSink > | TakeClientEnd () |
|
void | SetTags (const std::initializer_list< std::string > &tags) |
|
Definition at line 22 of file log_state.h.
◆ LogState()
fml::LogState::LogState |
( |
| ) |
|
Definition at line 27 of file log_state.cc.
27 {
28
29 auto client_end = component::Connect<fuchsia_logger::LogSink>();
30 ZX_ASSERT(client_end.is_ok());
31 fidl::SyncClient log_sink(std::move(*client_end));
32
33
34 zx::socket
local, remote;
36 auto result = log_sink->ConnectStructured({{.socket = std::move(remote)}});
37 ZX_ASSERT_MSG(
result.is_ok(),
"%s",
38 result.error_value().FormatDescription().c_str());
39
40
41
42 auto interest_result = log_sink->WaitForInterestChange();
43 ZX_ASSERT_MSG(interest_result.is_ok(), "%s",
44 interest_result.error_value().FormatDescription().c_str());
46
47 socket_ = std::move(
local);
48 client_end_ = log_sink.TakeClientEnd();
49}
static void HandleInterestChange(const fuchsia_diagnostics::Interest &interest)
◆ Default()
◆ SetTags()
void fml::LogState::SetTags |
( |
const std::initializer_list< std::string > & |
tags | ) |
|
Definition at line 56 of file log_state.cc.
56 {
57 std::atomic_store(&tags_,
58 std::make_shared<
const std::vector<std::string>>(
tags));
59}
std::shared_ptr< const std::vector< std::string > > tags() const
◆ socket()
const zx::socket & fml::LogState::socket |
( |
| ) |
const |
|
inline |
◆ tags()
std::shared_ptr< const std::vector< std::string > > fml::LogState::tags |
( |
| ) |
const |
|
inline |
Definition at line 31 of file log_state.h.
31 {
32 return std::atomic_load(&tags_);
33 }
◆ TakeClientEnd()
fidl::ClientEnd<::fuchsia_logger::LogSink > fml::LogState::TakeClientEnd |
( |
| ) |
|
Definition at line 51 of file log_state.cc.
51 {
52 std::lock_guard lock(mutex_);
53 return std::move(client_end_);
54}
The documentation for this class was generated from the following files: