llvm/lldb/source/Utility/Log.cpp

//===-- Log.cpp -----------------------------------------------------------===//
//
// 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/Utility/Log.h"
#include "lldb/Utility/VASPrintf.h"

#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator.h"

#include "llvm/Support/Casting.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"

#include <chrono>
#include <cstdarg>
#include <mutex>
#include <utility>

#include <cassert>
#if defined(_WIN32)
#include <process.h>
#else
#include <unistd.h>
#endif

usingnamespacelldb_private;

char LogHandler::ID;
char StreamLogHandler::ID;
char CallbackLogHandler::ID;
char RotatingLogHandler::ID;
char TeeLogHandler::ID;

llvm::ManagedStatic<Log::ChannelMap> Log::g_channel_map;

void Log::ForEachCategory(
    const Log::ChannelMap::value_type &entry,
    llvm::function_ref<void(llvm::StringRef, llvm::StringRef)> lambda) {}

void Log::ListCategories(llvm::raw_ostream &stream,
                         const ChannelMap::value_type &entry) {}

Log::MaskType Log::GetFlags(llvm::raw_ostream &stream,
                            const ChannelMap::value_type &entry,
                            llvm::ArrayRef<const char *> categories) {}

void Log::Enable(const std::shared_ptr<LogHandler> &handler_sp,
                 uint32_t options, Log::MaskType flags) {}

void Log::Disable(Log::MaskType flags) {}

bool Log::Dump(llvm::raw_ostream &output_stream) {}

const Flags Log::GetOptions() const {}

Log::MaskType Log::GetMask() const {}

void Log::PutCString(const char *cstr) {}

void Log::PutString(llvm::StringRef str) {}

// Simple variable argument logging with flags.
void Log::Printf(const char *format, ...) {}

void Log::VAPrintf(const char *format, va_list args) {}

void Log::Formatf(llvm::StringRef file, llvm::StringRef function,
                  const char *format, ...) {}

void Log::VAFormatf(llvm::StringRef file, llvm::StringRef function,
                    const char *format, va_list args) {}

// Printing of errors that are not fatal.
void Log::Error(const char *format, ...) {}

void Log::VAError(const char *format, va_list args) {}

// Printing of warnings that are not fatal only if verbose mode is enabled.
void Log::Verbose(const char *format, ...) {}

// Printing of warnings that are not fatal.
void Log::Warning(const char *format, ...) {}

void Log::Register(llvm::StringRef name, Channel &channel) {}

void Log::Unregister(llvm::StringRef name) {}

bool Log::EnableLogChannel(const std::shared_ptr<LogHandler> &log_handler_sp,
                           uint32_t log_options, llvm::StringRef channel,
                           llvm::ArrayRef<const char *> categories,
                           llvm::raw_ostream &error_stream) {}

bool Log::DisableLogChannel(llvm::StringRef channel,
                            llvm::ArrayRef<const char *> categories,
                            llvm::raw_ostream &error_stream) {}

bool Log::DumpLogChannel(llvm::StringRef channel,
                         llvm::raw_ostream &output_stream,
                         llvm::raw_ostream &error_stream) {}

bool Log::ListChannelCategories(llvm::StringRef channel,
                                llvm::raw_ostream &stream) {}

void Log::DisableAllLogChannels() {}

void Log::ForEachChannelCategory(
    llvm::StringRef channel,
    llvm::function_ref<void(llvm::StringRef, llvm::StringRef)> lambda) {}

std::vector<llvm::StringRef> Log::ListChannels() {}

void Log::ListAllLogChannels(llvm::raw_ostream &stream) {}

bool Log::GetVerbose() const {}

void Log::WriteHeader(llvm::raw_ostream &OS, llvm::StringRef file,
                      llvm::StringRef function) {}

// If we have a callback registered, then we call the logging callback. If we
// have a valid file handle, we also log to the file.
void Log::WriteMessage(llvm::StringRef message) {}

void Log::Format(llvm::StringRef file, llvm::StringRef function,
                 const llvm::formatv_object_base &payload) {}

StreamLogHandler::StreamLogHandler(int fd, bool should_close,
                                   size_t buffer_size)
    :{}

StreamLogHandler::~StreamLogHandler() {}

void StreamLogHandler::Flush() {}

void StreamLogHandler::Emit(llvm::StringRef message) {}

CallbackLogHandler::CallbackLogHandler(lldb::LogOutputCallback callback,
                                       void *baton)
    :{}

void CallbackLogHandler::Emit(llvm::StringRef message) {}

RotatingLogHandler::RotatingLogHandler(size_t size)
    :{}

void RotatingLogHandler::Emit(llvm::StringRef message) {}

size_t RotatingLogHandler::NormalizeIndex(size_t i) const {}

size_t RotatingLogHandler::GetNumMessages() const {}

size_t RotatingLogHandler::GetFirstMessageIndex() const {}

void RotatingLogHandler::Dump(llvm::raw_ostream &stream) const {}

TeeLogHandler::TeeLogHandler(std::shared_ptr<LogHandler> first_log_handler,
                             std::shared_ptr<LogHandler> second_log_handler)
    :{}

void TeeLogHandler::Emit(llvm::StringRef message) {}