blob: 7166d29dbf6c0c2339b7aaee5decdde27fe25f25 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "log_listener.h"
namespace netemul {
namespace internal {
// LogListenerImpl that forwards logs to a log sink.
// If a valid log sink socket is passed to the constructor, log
// messages will be sent to that socket. Otherwise, if an invalid
// log sink socket is passed to the constructor, the parent
// environment's log sink will be used. All log messages will
// be tagged with the supplied prefix.
class LogListenerLogSinkImpl : public LogListenerImpl {
LogListenerLogSinkImpl(fidl::InterfaceRequest<fuchsia::logger::LogListenerSafe> request,
std::string prefix, zx::socket log_sink,
async_dispatcher_t* dispatcher = nullptr);
virtual void LogImpl(fuchsia::logger::LogMessage m) override;
// log_sock_
// System log socket that logs will be redirected to.
zx::socket log_sock_;
} // namespace internal
} // namespace netemul