mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-23 08:05:07 +00:00
Make -v=1 work and log cflags for SemaManager session and Indexer
This commit is contained in:
parent
808aa120d1
commit
79732bf375
@ -40,4 +40,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))
|
||||
|
@ -74,6 +74,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");
|
||||
|
@ -288,7 +288,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) {
|
||||
|
@ -692,7 +692,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