aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Protocol/MCP/Transport.cpp
blob: 1dc01a9f59008e9133aef962a169297f1bfb2798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/Protocol/MCP/Transport.h"
#include "llvm/ADT/StringRef.h"
#include <utility>

using namespace lldb_protocol::mcp;
using namespace llvm;

Transport::Transport(lldb_private::MainLoop &loop, lldb::IOObjectSP in,
                     lldb::IOObjectSP out, LogCallback log_callback)
    : JSONRPCTransport(loop, in, out), m_log_callback(std::move(log_callback)) {
}

void Transport::Log(StringRef message) {
  if (m_log_callback)
    m_log_callback(message);
}