Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
log_interest_listener.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FML_PLATFORM_FUCHSIA_LOG_INTEREST_LISTENER_H_
6#define FLUTTER_FML_PLATFORM_FUCHSIA_LOG_INTEREST_LISTENER_H_
7
8#include <fidl/fuchsia.diagnostics/cpp/fidl.h>
9#include <fidl/fuchsia.logger/cpp/fidl.h>
10#include <lib/fidl/cpp/client.h>
11
12namespace fml {
13
14// Class to monitor the Fuchsia LogSink service for log interest changes (i.e.
15// when the Fuchsia OS requests a change to the minimum log level).
16//
17// Care should be taken to always use this object on the same thread.
19 public:
20 LogInterestListener(fidl::ClientEnd<::fuchsia_logger::LogSink> client_end,
21 async_dispatcher_t* dispatcher)
22 : log_sink_(std::move(client_end), dispatcher) {}
23
24 // Schedules async task to monitor the log sink for log interest changes.
26
27 // Updates the global log settings in response to a log interest change.
28 static void HandleInterestChange(
29 const fuchsia_diagnostics::Interest& interest);
30
31 private:
32 fidl::Client<::fuchsia_logger::LogSink> log_sink_;
33};
34
35} // namespace fml
36
37#endif // FLUTTER_FML_PLATFORM_FUCHSIA_LOG_INTEREST_LISTENER_H_
static void HandleInterestChange(const fuchsia_diagnostics::Interest &interest)
LogInterestListener(fidl::ClientEnd<::fuchsia_logger::LogSink > client_end, async_dispatcher_t *dispatcher)
Definition ref_ptr.h:256