mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 08:35:08 +00:00
Make -v=1 work and log cflags for SemaManager session and Indexer
This commit is contained in:
parent
18e4be616c
commit
8ca0978804
@ -37,4 +37,5 @@ struct Message {
|
||||
#define LOG_IF_S(v, cond) \
|
||||
LOG_IF(ccls::log::Verbosity_##v, \
|
||||
(cond) && ccls::log::Verbosity_##v <= ccls::log::verbosity)
|
||||
#define LOG_V(v) LOG_IF(ccls::log::Verbosity(v), v <= ccls::log::verbosity)
|
||||
#define LOG_V_ENABLED(v) (v <= ccls::log::verbosity)
|
||||
#define LOG_V(v) LOG_IF(ccls::log::Verbosity(v), LOG_V_ENABLED(v))
|
||||
|
@ -86,6 +86,7 @@ int main(int argc, char **argv) {
|
||||
PrintHelpMessage();
|
||||
return 0;
|
||||
}
|
||||
ccls::log::verbosity = ccls::log::Verbosity(opt_verbose.getValue());
|
||||
|
||||
pipeline::Init();
|
||||
const char *env = getenv("CCLS_CRASH_RECOVERY");
|
||||
|
@ -300,7 +300,15 @@ bool Indexer_Parse(SemaManager *completion, WorkingFiles *wfiles,
|
||||
return true;
|
||||
} while (0);
|
||||
|
||||
LOG_IF_S(INFO, loud) << "parse " << path_to_index;
|
||||
if (loud) {
|
||||
std::string line;
|
||||
if (LOG_V_ENABLED(1)) {
|
||||
line = "\n ";
|
||||
for (auto &arg : entry.args)
|
||||
(line += ' ') += arg;
|
||||
}
|
||||
LOG_S(INFO) << "parse " << path_to_index << line;
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> remapped;
|
||||
if (g_config->index.onChange) {
|
||||
|
@ -703,7 +703,13 @@ SemaManager::EnsureSession(const std::string &path, bool *created) {
|
||||
if (!session) {
|
||||
session = std::make_shared<ccls::Session>(
|
||||
project_->FindEntry(path, false), wfiles, PCH);
|
||||
LOG_S(INFO) << "create session for " << path;
|
||||
std::string line;
|
||||
if (LOG_V_ENABLED(1)) {
|
||||
line = "\n ";
|
||||
for (auto &arg : session->file.args)
|
||||
(line += ' ') += arg;
|
||||
}
|
||||
LOG_S(INFO) << "create session for " << path << line;
|
||||
sessions.Insert(path, session);
|
||||
if (created)
|
||||
*created = true;
|
||||
|
Loading…
Reference in New Issue
Block a user