mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Replace loguru with a custom logger
This commit is contained in:
parent
a6094ef714
commit
cf0d16fa0c
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -4,6 +4,3 @@
|
|||||||
[submodule "third_party/doctest"]
|
[submodule "third_party/doctest"]
|
||||||
path = third_party/doctest
|
path = third_party/doctest
|
||||||
url = https://github.com/onqtam/doctest
|
url = https://github.com/onqtam/doctest
|
||||||
[submodule "third_party/loguru"]
|
|
||||||
path = third_party/loguru
|
|
||||||
url = https://github.com/emilk/loguru
|
|
||||||
|
@ -201,14 +201,15 @@ target_sources(ccls PRIVATE
|
|||||||
src/filesystem.cc
|
src/filesystem.cc
|
||||||
src/fuzzy_match.cc
|
src/fuzzy_match.cc
|
||||||
src/main.cc
|
src/main.cc
|
||||||
src/import_pipeline.cc
|
|
||||||
src/include_complete.cc
|
src/include_complete.cc
|
||||||
src/method.cc
|
src/method.cc
|
||||||
src/language.cc
|
src/language.cc
|
||||||
src/lex_utils.cc
|
src/lex_utils.cc
|
||||||
|
src/log.cc
|
||||||
src/lsp.cc
|
src/lsp.cc
|
||||||
src/match.cc
|
src/match.cc
|
||||||
src/message_handler.cc
|
src/message_handler.cc
|
||||||
|
src/pipeline.cc
|
||||||
src/platform_posix.cc
|
src/platform_posix.cc
|
||||||
src/platform_win.cc
|
src/platform_win.cc
|
||||||
src/port.cc
|
src/port.cc
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "lsp.h"
|
#include "lsp.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
#include "clang_complete.h"
|
#include "clang_complete.h"
|
||||||
|
|
||||||
#include "clang_utils.h"
|
#include "clang_utils.h"
|
||||||
|
#include "filesystem.hh"
|
||||||
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
#include "filesystem.hh"
|
#include <llvm/ADT/Twine.h>
|
||||||
|
#include <llvm/Support/Threading.h>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
@ -660,15 +661,15 @@ ClangCompleteManager::ClangCompleteManager(Project* project,
|
|||||||
preloaded_sessions_(kMaxPreloadedSessions),
|
preloaded_sessions_(kMaxPreloadedSessions),
|
||||||
completion_sessions_(kMaxCompletionSessions) {
|
completion_sessions_(kMaxCompletionSessions) {
|
||||||
std::thread([&]() {
|
std::thread([&]() {
|
||||||
SetThreadName("comp-query");
|
set_thread_name("comp-query");
|
||||||
CompletionQueryMain(this);
|
CompletionQueryMain(this);
|
||||||
}).detach();
|
}).detach();
|
||||||
std::thread([&]() {
|
std::thread([&]() {
|
||||||
SetThreadName("comp-preload");
|
set_thread_name("comp-preload");
|
||||||
CompletionPreloadMain(this);
|
CompletionPreloadMain(this);
|
||||||
}).detach();
|
}).detach();
|
||||||
std::thread([&]() {
|
std::thread([&]() {
|
||||||
SetThreadName("diag-query");
|
set_thread_name("diag-query");
|
||||||
DiagnosticQueryMain(this);
|
DiagnosticQueryMain(this);
|
||||||
}).detach();
|
}).detach();
|
||||||
}
|
}
|
||||||
@ -803,10 +804,11 @@ void ClangCompleteManager::FlushSession(const std::string& filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClangCompleteManager::FlushAllSessions() {
|
void ClangCompleteManager::FlushAllSessions() {
|
||||||
std::lock_guard<std::mutex> lock(sessions_lock_);
|
LOG_S(INFO) << "flush all clang complete sessions";
|
||||||
|
std::lock_guard<std::mutex> lock(sessions_lock_);
|
||||||
|
|
||||||
preloaded_sessions_.Clear();
|
preloaded_sessions_.Clear();
|
||||||
completion_sessions_.Clear();
|
completion_sessions_.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeCompleteCache::WithLock(std::function<void()> action) {
|
void CodeCompleteCache::WithLock(std::function<void()> action) {
|
||||||
|
@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
#include "clang_cursor.h"
|
#include "clang_cursor.h"
|
||||||
#include "clang_utils.h"
|
#include "clang_utils.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "type_printer.h"
|
#include "type_printer.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#include "clang_translation_unit.h"
|
#include "clang_translation_unit.h"
|
||||||
|
|
||||||
#include "clang_utils.h"
|
#include "clang_utils.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void EmitDiagnostics(std::string path,
|
void EmitDiagnostics(std::string path,
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
#include "clang_utils.h"
|
#include "clang_utils.h"
|
||||||
#include "indexer.h"
|
#include "indexer.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::optional<std::string> GetFileContents(
|
std::optional<std::string> GetFileContents(
|
||||||
@ -108,8 +107,8 @@ IndexFile* FileConsumer::TryConsumeFile(
|
|||||||
if (clang_getFileUniqueID(file, &file_id) != 0) {
|
if (clang_getFileUniqueID(file, &file_id) != 0) {
|
||||||
std::string file_name = FileName(file);
|
std::string file_name = FileName(file);
|
||||||
if (!file_name.empty()) {
|
if (!file_name.empty()) {
|
||||||
// LOG_S(ERROR) << "Could not get unique file id for " << file_name
|
LOG_S(ERROR) << "Could not get unique file id for " << file_name
|
||||||
// << " when parsing " << parse_file_;
|
<< " when parsing " << parse_file_;
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
|
#include <llvm/ADT/Twine.h>
|
||||||
|
#include <llvm/Support/Threading.h>
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -103,7 +107,7 @@ void IncludeComplete::Rescan() {
|
|||||||
|
|
||||||
is_scanning = true;
|
is_scanning = true;
|
||||||
std::thread([this]() {
|
std::thread([this]() {
|
||||||
SetThreadName("scan_includes");
|
set_thread_name("scan_includes");
|
||||||
Timer timer;
|
Timer timer;
|
||||||
|
|
||||||
for (const std::string& dir : project_->quote_include_directories)
|
for (const std::string& dir : project_->quote_include_directories)
|
||||||
|
62
src/log.cc
Normal file
62
src/log.cc
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include "log.hh"
|
||||||
|
|
||||||
|
#include <llvm/ADT/SmallString.h>
|
||||||
|
#include <llvm/Support/Threading.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
namespace ccls::log {
|
||||||
|
static std::mutex mtx;
|
||||||
|
FILE* file;
|
||||||
|
Verbosity verbosity;
|
||||||
|
|
||||||
|
Message::Message(Verbosity verbosity, const char* file, int line)
|
||||||
|
: verbosity_(verbosity) {
|
||||||
|
using namespace llvm;
|
||||||
|
time_t tim = time(NULL);
|
||||||
|
struct tm t;
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(mtx);
|
||||||
|
t = *localtime(&tim);
|
||||||
|
}
|
||||||
|
char buf[16];
|
||||||
|
snprintf(buf, sizeof buf, "%02d:%02d:%02d ", t.tm_hour, t.tm_min, t.tm_sec);
|
||||||
|
stream_ << buf;
|
||||||
|
{
|
||||||
|
SmallString<32> Name;
|
||||||
|
get_thread_name(Name);
|
||||||
|
stream_ << std::left << std::setw(13) << Name.c_str();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const char* p = strrchr(file, '/');
|
||||||
|
if (p)
|
||||||
|
file = p + 1;
|
||||||
|
stream_ << std::right << std::setw(15) << file << ':' << std::left
|
||||||
|
<< std::setw(3) << line;
|
||||||
|
}
|
||||||
|
stream_ << ' ';
|
||||||
|
// clang-format off
|
||||||
|
switch (verbosity_) {
|
||||||
|
case Verbosity_FATAL: stream_ << 'F'; break;
|
||||||
|
case Verbosity_ERROR: stream_ << 'E'; break;
|
||||||
|
case Verbosity_WARNING: stream_ << 'W'; break;
|
||||||
|
case Verbosity_INFO: stream_ << 'I'; break;
|
||||||
|
default: stream_ << "V(" << int(verbosity_) << ')';
|
||||||
|
}
|
||||||
|
// clang-format on
|
||||||
|
stream_ << ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
Message::~Message() {
|
||||||
|
if (!file) return;
|
||||||
|
std::lock_guard<std::mutex> lock(mtx);
|
||||||
|
stream_ << '\n';
|
||||||
|
fputs(stream_.str().c_str(), file);
|
||||||
|
if (verbosity_ == Verbosity_FATAL)
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
}
|
40
src/log.hh
Normal file
40
src/log.hh
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
namespace ccls::log {
|
||||||
|
extern FILE* file;
|
||||||
|
|
||||||
|
struct Voidify {
|
||||||
|
void operator&(const std::ostream&) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Verbosity {
|
||||||
|
Verbosity_FATAL = -3,
|
||||||
|
Verbosity_ERROR = -2,
|
||||||
|
Verbosity_WARNING = -1,
|
||||||
|
Verbosity_INFO = 0,
|
||||||
|
};
|
||||||
|
extern Verbosity verbosity;
|
||||||
|
|
||||||
|
struct Message {
|
||||||
|
std::stringstream stream_;
|
||||||
|
int verbosity_;
|
||||||
|
|
||||||
|
Message(Verbosity verbosity, const char* file, int line);
|
||||||
|
~Message();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LOG_IF(v, cond) \
|
||||||
|
!(cond) ? void(0) \
|
||||||
|
: ccls::log::Voidify() & \
|
||||||
|
ccls::log::Message(v, __FILE__, __LINE__).stream_
|
||||||
|
#define LOG_S(v) \
|
||||||
|
LOG_IF(ccls::log::Verbosity_##v, \
|
||||||
|
ccls::log::Verbosity_##v <= ccls::log::verbosity)
|
||||||
|
#define LOG_IF_S(v, cond) \
|
||||||
|
LOG_IF(ccls::log::Verbosity_##v, \
|
||||||
|
(cond) && ccls::log::Verbosity_##v <= ccls::log::verbosity)
|
||||||
|
#define CHECK_S(cond) LOG_IF(FATAL, !(cond)) << "check failed: " #cond " "
|
42
src/lsp.cc
42
src/lsp.cc
@ -1,10 +1,9 @@
|
|||||||
#include "lsp.h"
|
#include "lsp.h"
|
||||||
|
|
||||||
|
#include "log.hh"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.h"
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
|
||||||
#include <rapidjson/writer.h>
|
#include <rapidjson/writer.h>
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -68,45 +67,6 @@ std::optional<std::string> ReadJsonRpcContentFrom(
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::function<std::optional<char>()> MakeContentReader(std::string* content,
|
|
||||||
bool can_be_empty) {
|
|
||||||
return [content, can_be_empty]() -> std::optional<char> {
|
|
||||||
if (!can_be_empty)
|
|
||||||
REQUIRE(!content->empty());
|
|
||||||
if (content->empty())
|
|
||||||
return std::nullopt;
|
|
||||||
char c = (*content)[0];
|
|
||||||
content->erase(content->begin());
|
|
||||||
return c;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_SUITE("FindIncludeLine") {
|
|
||||||
TEST_CASE("ReadContentFromSource") {
|
|
||||||
auto parse_correct = [](std::string content) -> std::string {
|
|
||||||
auto reader = MakeContentReader(&content, false /*can_be_empty*/);
|
|
||||||
auto got = ReadJsonRpcContentFrom(reader);
|
|
||||||
REQUIRE(got);
|
|
||||||
return got.value();
|
|
||||||
};
|
|
||||||
|
|
||||||
auto parse_incorrect = [](std::string content) -> std::optional<std::string> {
|
|
||||||
auto reader = MakeContentReader(&content, true /*can_be_empty*/);
|
|
||||||
return ReadJsonRpcContentFrom(reader);
|
|
||||||
};
|
|
||||||
|
|
||||||
REQUIRE(parse_correct("Content-Length: 0\r\n\r\n") == "");
|
|
||||||
REQUIRE(parse_correct("Content-Length: 1\r\n\r\na") == "a");
|
|
||||||
REQUIRE(parse_correct("Content-Length: 4\r\n\r\nabcd") == "abcd");
|
|
||||||
|
|
||||||
REQUIRE(parse_incorrect("ggg") == std::optional<std::string>());
|
|
||||||
REQUIRE(parse_incorrect("Content-Length: 0\r\n") ==
|
|
||||||
std::optional<std::string>());
|
|
||||||
REQUIRE(parse_incorrect("Content-Length: 5\r\n\r\nab") ==
|
|
||||||
std::optional<std::string>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<char> ReadCharFromStdinBlocking() {
|
std::optional<char> ReadCharFromStdinBlocking() {
|
||||||
// We do not use std::cin because it does not read bytes once stuck in
|
// We do not use std::cin because it does not read bytes once stuck in
|
||||||
// cin.bad(). We can call cin.clear() but C++ iostream has other annoyance
|
// cin.bad(). We can call cin.clear() but C++ iostream has other annoyance
|
||||||
|
@ -304,14 +304,6 @@ struct lsWorkspaceEdit {
|
|||||||
};
|
};
|
||||||
MAKE_REFLECT_STRUCT(lsWorkspaceEdit, documentChanges);
|
MAKE_REFLECT_STRUCT(lsWorkspaceEdit, documentChanges);
|
||||||
|
|
||||||
struct lsFormattingOptions {
|
|
||||||
// Size of a tab in spaces.
|
|
||||||
int tabSize;
|
|
||||||
// Prefer spaces over tabs.
|
|
||||||
bool insertSpaces;
|
|
||||||
};
|
|
||||||
MAKE_REFLECT_STRUCT(lsFormattingOptions, tabSize, insertSpaces);
|
|
||||||
|
|
||||||
// MarkedString can be used to render human readable text. It is either a
|
// MarkedString can be used to render human readable text. It is either a
|
||||||
// markdown string or a code-block that provides a language and a code snippet.
|
// markdown string or a code-block that provides a language and a code snippet.
|
||||||
// The language identifier is sematically equal to the std::optional language
|
// The language identifier is sematically equal to the std::optional language
|
||||||
|
34
src/main.cc
34
src/main.cc
@ -1,4 +1,5 @@
|
|||||||
#include "import_pipeline.h"
|
#include "log.hh"
|
||||||
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.h"
|
||||||
@ -7,12 +8,12 @@
|
|||||||
|
|
||||||
#include <llvm/Support/CommandLine.h>
|
#include <llvm/Support/CommandLine.h>
|
||||||
#include <llvm/Support/Process.h>
|
#include <llvm/Support/Process.h>
|
||||||
|
#include <llvm/Support/Signals.h>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::cl;
|
using namespace llvm::cl;
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
#include <rapidjson/error/en.h>
|
#include <rapidjson/error/en.h>
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -34,10 +35,15 @@ opt<std::string> opt_log_file_append("log-file-append", desc("log"), value_desc(
|
|||||||
|
|
||||||
list<std::string> opt_extra(Positional, ZeroOrMore, desc("extra"));
|
list<std::string> opt_extra(Positional, ZeroOrMore, desc("extra"));
|
||||||
|
|
||||||
|
void CloseLog() {
|
||||||
|
fclose(ccls::log::file);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
TraceMe();
|
TraceMe();
|
||||||
|
sys::PrintStackTraceOnErrorSignal(argv[0]);
|
||||||
|
|
||||||
ParseCommandLineOptions(argc, argv,
|
ParseCommandLineOptions(argc, argv,
|
||||||
"C/C++/Objective-C language server\n\n"
|
"C/C++/Objective-C language server\n\n"
|
||||||
@ -50,13 +56,6 @@ int main(int argc, char** argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
loguru::g_stderr_verbosity = opt_verbose - 1;
|
|
||||||
loguru::g_preamble_date = false;
|
|
||||||
loguru::g_preamble_time = false;
|
|
||||||
loguru::g_preamble_verbose = false;
|
|
||||||
loguru::g_flush_interval_ms = 0;
|
|
||||||
loguru::init(argc, argv);
|
|
||||||
|
|
||||||
MultiQueueWaiter querydb_waiter, indexer_waiter, stdout_waiter;
|
MultiQueueWaiter querydb_waiter, indexer_waiter, stdout_waiter;
|
||||||
QueueManager::Init(&querydb_waiter, &indexer_waiter, &stdout_waiter);
|
QueueManager::Init(&querydb_waiter, &indexer_waiter, &stdout_waiter);
|
||||||
|
|
||||||
@ -72,10 +71,19 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
bool language_server = true;
|
bool language_server = true;
|
||||||
|
|
||||||
if (opt_log_file.size())
|
if (opt_log_file.size() || opt_log_file_append.size()) {
|
||||||
loguru::add_file(opt_log_file.c_str(), loguru::Truncate, opt_verbose);
|
ccls::log::file = opt_log_file.size()
|
||||||
if (opt_log_file_append.size())
|
? fopen(opt_log_file.c_str(), "wb")
|
||||||
loguru::add_file(opt_log_file_append.c_str(), loguru::Append, opt_verbose);
|
: fopen(opt_log_file_append.c_str(), "ab");
|
||||||
|
if (!ccls::log::file) {
|
||||||
|
fprintf(
|
||||||
|
stderr, "failed to open %s\n",
|
||||||
|
(opt_log_file.size() ? opt_log_file : opt_log_file_append).c_str());
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
setbuf(ccls::log::file, NULL);
|
||||||
|
atexit(CloseLog);
|
||||||
|
}
|
||||||
|
|
||||||
if (opt_test_unit) {
|
if (opt_test_unit) {
|
||||||
language_server = false;
|
language_server = false;
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#include "message_handler.h"
|
#include "message_handler.h"
|
||||||
|
|
||||||
#include "lex_utils.h"
|
#include "lex_utils.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
MAKE_HASHABLE(SymbolIdx, t.usr, t.kind);
|
MAKE_HASHABLE(SymbolIdx, t.usr, t.kind);
|
||||||
@ -156,14 +155,7 @@ bool FindFileOrFail(QueryDatabase* db,
|
|||||||
if (indexing)
|
if (indexing)
|
||||||
LOG_S(INFO) << "\"" << absolute_path << "\" is being indexed.";
|
LOG_S(INFO) << "\"" << absolute_path << "\" is being indexed.";
|
||||||
else
|
else
|
||||||
LOG_S(INFO) << "Unable to find file \"" << absolute_path << "\"";
|
LOG_S(INFO) << "unable to find file \"" << absolute_path << "\"";
|
||||||
/*
|
|
||||||
LOG_S(INFO) << "Files (size=" << db->usr_to_file.size() << "): "
|
|
||||||
<< StringJoinMap(db->usr_to_file,
|
|
||||||
[](const std::pair<NormalizedPath, QueryFileId>& entry) {
|
|
||||||
return entry.first.path;
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
Out_Error out;
|
Out_Error out;
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
#include "cache_manager.h"
|
#include "cache_manager.h"
|
||||||
#include "import_pipeline.h"
|
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "message_handler.h"
|
#include "message_handler.h"
|
||||||
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "message_handler.h"
|
#include "message_handler.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct In_Exit : public NotificationInMessage {
|
struct In_Exit : public NotificationInMessage {
|
||||||
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
||||||
@ -13,7 +11,6 @@ struct Handler_Exit : MessageHandler {
|
|||||||
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
MethodType GetMethodType() const override { return kMethodType_Exit; }
|
||||||
|
|
||||||
void Run(std::unique_ptr<InMessage> request) override {
|
void Run(std::unique_ptr<InMessage> request) override {
|
||||||
LOG_S(INFO) << "Exiting; got exit message";
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#include "cache_manager.h"
|
#include "cache_manager.h"
|
||||||
#include "diagnostics_engine.h"
|
#include "diagnostics_engine.h"
|
||||||
#include "import_pipeline.h"
|
#include "filesystem.hh"
|
||||||
#include "include_complete.h"
|
#include "include_complete.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "message_handler.h"
|
#include "message_handler.h"
|
||||||
|
#include "pipeline.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
@ -10,11 +12,10 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include "filesystem.hh"
|
#include <llvm/ADT/Twine.h>
|
||||||
|
#include <llvm/Support/Threading.h>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@ -508,12 +509,12 @@ struct Handler_Initialize : BaseMessageHandler<In_InitializeRequest> {
|
|||||||
if (g_config->index.threads == 0)
|
if (g_config->index.threads == 0)
|
||||||
g_config->index.threads = std::thread::hardware_concurrency();
|
g_config->index.threads = std::thread::hardware_concurrency();
|
||||||
|
|
||||||
LOG_S(INFO) << "Starting " << g_config->index.threads << " indexers";
|
LOG_S(INFO) << "start " << g_config->index.threads << " indexers";
|
||||||
for (int i = 0; i < g_config->index.threads; i++) {
|
for (int i = 0; i < g_config->index.threads; i++) {
|
||||||
std::thread([=]() {
|
std::thread([=]() {
|
||||||
g_thread_id = i + 1;
|
g_thread_id = i + 1;
|
||||||
std::string name = "indexer" + std::to_string(i);
|
std::string name = "indexer" + std::to_string(i);
|
||||||
SetThreadName(name.c_str());
|
set_thread_name(name.c_str());
|
||||||
Indexer_Main(diag_engine, vfs, project, working_files, waiter);
|
Indexer_Main(diag_engine, vfs, project, working_files, waiter);
|
||||||
}).detach();
|
}).detach();
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#include "lex_utils.h"
|
#include "lex_utils.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
MethodType kMethodType = "textDocument/didChange";
|
MethodType kMethodType = "textDocument/didChange";
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
MethodType kMethodType = "textDocument/didOpen";
|
MethodType kMethodType = "textDocument/didOpen";
|
||||||
|
|
||||||
@ -69,7 +67,6 @@ struct Handler_TextDocumentDidOpen
|
|||||||
true /* priority */);
|
true /* priority */);
|
||||||
|
|
||||||
clang_complete->FlushSession(entry.filename);
|
clang_complete->FlushSession(entry.filename);
|
||||||
LOG_S(INFO) << "Flushed clang complete sessions for " << entry.filename;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
MethodType kMethodType = "textDocument/didSave";
|
MethodType kMethodType = "textDocument/didSave";
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
MethodType kMethodType = "workspace/didChangeConfiguration";
|
MethodType kMethodType = "workspace/didChangeConfiguration";
|
||||||
|
|
||||||
@ -38,7 +36,6 @@ struct Handler_WorkspaceDidChangeConfiguration
|
|||||||
"[perf] Dispatched workspace/didChangeConfiguration index requests");
|
"[perf] Dispatched workspace/didChangeConfiguration index requests");
|
||||||
|
|
||||||
clang_complete->FlushAllSessions();
|
clang_complete->FlushAllSessions();
|
||||||
LOG_S(INFO) << "Flushed all clang complete sessions";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
REGISTER_MESSAGE_HANDLER(Handler_WorkspaceDidChangeConfiguration);
|
REGISTER_MESSAGE_HANDLER(Handler_WorkspaceDidChangeConfiguration);
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
MethodType kMethodType = "workspace/didChangeWatchedFiles";
|
MethodType kMethodType = "workspace/didChangeWatchedFiles";
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -70,9 +68,6 @@ struct Handler_WorkspaceSymbol : BaseMessageHandler<In_WorkspaceSymbol> {
|
|||||||
Out_WorkspaceSymbol out;
|
Out_WorkspaceSymbol out;
|
||||||
out.id = request->id;
|
out.id = request->id;
|
||||||
|
|
||||||
LOG_S(INFO) << "[querydb] Considering " << db->symbols.size()
|
|
||||||
<< " candidates for query " << request->params.query;
|
|
||||||
|
|
||||||
std::string query = request->params.query;
|
std::string query = request->params.query;
|
||||||
|
|
||||||
// {symbol info, matching detailed_name or short_name, index}
|
// {symbol info, matching detailed_name or short_name, index}
|
||||||
@ -129,8 +124,6 @@ struct Handler_WorkspaceSymbol : BaseMessageHandler<In_WorkspaceSymbol> {
|
|||||||
out.result.push_back(std::get<0>(entry));
|
out.result.push_back(std::get<0>(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_S(INFO) << "[querydb] Found " << out.result.size()
|
|
||||||
<< " results for query " << query;
|
|
||||||
QueueManager::WriteStdout(kMethodType, out);
|
QueueManager::WriteStdout(kMethodType, out);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#include "import_pipeline.h"
|
#include "pipeline.hh"
|
||||||
|
|
||||||
#include "cache_manager.h"
|
#include "cache_manager.h"
|
||||||
#include "clang_complete.h"
|
#include "clang_complete.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "diagnostics_engine.h"
|
#include "diagnostics_engine.h"
|
||||||
#include "include_complete.h"
|
#include "include_complete.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "lsp.h"
|
#include "lsp.h"
|
||||||
#include "message_handler.h"
|
#include "message_handler.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
@ -13,8 +14,9 @@
|
|||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
#include <llvm/ADT/Twine.h>
|
||||||
#include <loguru.hpp>
|
#include <llvm/Support/Threading.h>
|
||||||
|
using namespace llvm;
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@ -275,7 +277,7 @@ void QueryDb_OnIndexed(QueueManager* queue,
|
|||||||
|
|
||||||
void LaunchStdinLoop(std::unordered_map<MethodType, Timer>* request_times) {
|
void LaunchStdinLoop(std::unordered_map<MethodType, Timer>* request_times) {
|
||||||
std::thread([request_times]() {
|
std::thread([request_times]() {
|
||||||
SetThreadName("stdin");
|
set_thread_name("stdin");
|
||||||
auto* queue = QueueManager::instance();
|
auto* queue = QueueManager::instance();
|
||||||
while (true) {
|
while (true) {
|
||||||
std::unique_ptr<InMessage> message;
|
std::unique_ptr<InMessage> message;
|
||||||
@ -316,7 +318,7 @@ void LaunchStdinLoop(std::unordered_map<MethodType, Timer>* request_times) {
|
|||||||
void LaunchStdoutThread(std::unordered_map<MethodType, Timer>* request_times,
|
void LaunchStdoutThread(std::unordered_map<MethodType, Timer>* request_times,
|
||||||
MultiQueueWaiter* waiter) {
|
MultiQueueWaiter* waiter) {
|
||||||
std::thread([=]() {
|
std::thread([=]() {
|
||||||
SetThreadName("stdout");
|
set_thread_name("stdout");
|
||||||
auto* queue = QueueManager::instance();
|
auto* queue = QueueManager::instance();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
std::string NormalizePath(const std::string& path);
|
std::string NormalizePath(const std::string& path);
|
||||||
|
|
||||||
void SetThreadName(const char* name);
|
|
||||||
|
|
||||||
// Free any unused memory and return it to the system.
|
// Free any unused memory and return it to the system.
|
||||||
void FreeUnusedMemory();
|
void FreeUnusedMemory();
|
||||||
|
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
#include <llvm/ADT/Twine.h>
|
|
||||||
#include <llvm/Support/Threading.h>
|
|
||||||
|
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
#if defined(__unix__) || defined(__APPLE__)
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -160,8 +155,3 @@ std::string GetExternalCommandOutput(const std::vector<std::string>& command,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SetThreadName(const char* name) {
|
|
||||||
loguru::set_thread_name(name);
|
|
||||||
llvm::set_thread_name(name);
|
|
||||||
}
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "clang_utils.h"
|
#include "clang_utils.h"
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
@ -25,7 +26,6 @@ using namespace llvm::opt;
|
|||||||
#include <clang-c/CXCompilationDatabase.h>
|
#include <clang-c/CXCompilationDatabase.h>
|
||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
#include <rapidjson/writer.h>
|
#include <rapidjson/writer.h>
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
#if defined(__unix__) || defined(__APPLE__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include "serializers/json.h"
|
#include "serializers/json.h"
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
#include "queue_manager.h"
|
#include "queue_manager.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <climits>
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
|
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
|
#include "log.hh"
|
||||||
#include "serializers/binary.h"
|
#include "serializers/binary.h"
|
||||||
#include "serializers/json.h"
|
#include "serializers/json.h"
|
||||||
|
|
||||||
#include "indexer.h"
|
#include "indexer.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -414,7 +413,7 @@ std::unique_ptr<IndexFile> Deserialize(
|
|||||||
file = std::make_unique<IndexFile>(path, file_content);
|
file = std::make_unique<IndexFile>(path, file_content);
|
||||||
Reflect(reader, *file);
|
Reflect(reader, *file);
|
||||||
} catch (std::invalid_argument& e) {
|
} catch (std::invalid_argument& e) {
|
||||||
LOG_S(INFO) << "Failed to deserialize '" << path
|
LOG_S(INFO) << "failed to deserialize '" << path
|
||||||
<< "': " << e.what();
|
<< "': " << e.what();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include <rapidjson/prettywriter.h>
|
#include <rapidjson/prettywriter.h>
|
||||||
#include <rapidjson/stringbuffer.h>
|
#include <rapidjson/stringbuffer.h>
|
||||||
#include <rapidjson/writer.h>
|
#include <rapidjson/writer.h>
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
#define DOCTEST_CONFIG_IMPLEMENT
|
#define DOCTEST_CONFIG_IMPLEMENT
|
||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
|
|
||||||
#define LOGURU_IMPLEMENTATION 1
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
#include "log.hh"
|
||||||
|
|
||||||
Timer::Timer() {
|
Timer::Timer() {
|
||||||
Reset();
|
Reset();
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "type_printer.h"
|
#include "type_printer.h"
|
||||||
|
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
int GetNameInsertingPosition(const std::string& type_desc,
|
int GetNameInsertingPosition(const std::string& type_desc,
|
||||||
@ -82,12 +80,8 @@ std::tuple<std::string, int16_t, int16_t, int16_t> GetFunctionSignature(
|
|||||||
std::string type_desc_with_names(type_desc.begin(), type_desc.begin() + i);
|
std::string type_desc_with_names(type_desc.begin(), type_desc.begin() + i);
|
||||||
type_desc_with_names.append(func_name);
|
type_desc_with_names.append(func_name);
|
||||||
for (auto& arg : args) {
|
for (auto& arg : args) {
|
||||||
if (arg.first < 0) {
|
if (arg.first < 0)
|
||||||
LOG_S(ERROR)
|
|
||||||
<< "When adding argument names to '" << type_desc
|
|
||||||
<< "', failed to detect positions to insert argument names";
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
if (arg.second.empty())
|
if (arg.second.empty())
|
||||||
continue;
|
continue;
|
||||||
// TODO Use inside-out syntax. Note, clang/lib/AST/TypePrinter.cpp does
|
// TODO Use inside-out syntax. Note, clang/lib/AST/TypePrinter.cpp does
|
||||||
|
@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
#include "filesystem.hh"
|
#include "filesystem.hh"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
#include "log.hh"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
|
||||||
#include <siphash.h>
|
#include <siphash.h>
|
||||||
#include <loguru/loguru.hpp>
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "working_files.h"
|
#include "working_files.h"
|
||||||
|
|
||||||
#include "lex_utils.h"
|
#include "lex_utils.h"
|
||||||
|
#include "log.hh"
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
|
|
||||||
#include <doctest/doctest.h>
|
#include <doctest/doctest.h>
|
||||||
#include <loguru.hpp>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
@ -320,23 +320,9 @@ void WorkingFile::ComputeLineMapping() {
|
|||||||
std::optional<int> WorkingFile::GetBufferPosFromIndexPos(int line,
|
std::optional<int> WorkingFile::GetBufferPosFromIndexPos(int line,
|
||||||
int* column,
|
int* column,
|
||||||
bool is_end) {
|
bool is_end) {
|
||||||
// The implementation is simple but works pretty well for most cases. We
|
|
||||||
// lookup the line contents in the indexed file contents, and try to find the
|
|
||||||
// most similar line in the current buffer file.
|
|
||||||
//
|
|
||||||
// Previously, this was implemented by tracking edits and by running myers
|
|
||||||
// diff algorithm. They were complex implementations that did not work as
|
|
||||||
// well.
|
|
||||||
|
|
||||||
// Note: |index_line| and |buffer_line| are 1-based.
|
|
||||||
|
|
||||||
// TODO: reenable this assert once we are using the real indexed file.
|
|
||||||
// assert(index_line >= 1 && index_line <= index_lines.size());
|
|
||||||
if (line < 0 || line >= (int)index_lines.size()) {
|
if (line < 0 || line >= (int)index_lines.size()) {
|
||||||
loguru::Text stack = loguru::stacktrace();
|
LOG_S(WARNING) << "bad index_line (got " << line << ", expected [0, "
|
||||||
LOG_S(WARNING) << "Bad index_line (got " << line << ", expected [0, "
|
<< index_lines.size() << ")) in " << filename;
|
||||||
<< index_lines.size() << ")) in " << filename
|
|
||||||
<< stack.c_str();
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
third_party/loguru
vendored
1
third_party/loguru
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit 6bf94c5f2bec437e871402d0a27e8a3094b261d5
|
|
Loading…
Reference in New Issue
Block a user