aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Protocol/MCP/Transport.cpp
blob: cccdc3b5bd65c760481118ee0cc60eef80eb6cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//===----------------------------------------------------------------------===//
//
// 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::IOObjectSP in, lldb::IOObjectSP out,
                     LogCallback log_callback)
    : JSONRPCTransport(in, out), m_log_callback(std::move(log_callback)) {}

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