mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-24 08:35:08 +00:00
Log {Request,Notification}Message, and timestamp change due to dependency
This commit is contained in:
parent
d4de474be1
commit
f1efcb80c7
@ -49,7 +49,8 @@ namespace {
|
|||||||
OptionCategory C("ccls options");
|
OptionCategory C("ccls options");
|
||||||
|
|
||||||
opt<bool> opt_help("h", desc("Alias for -help"), cat(C));
|
opt<bool> opt_help("h", desc("Alias for -help"), cat(C));
|
||||||
opt<int> opt_verbose("v", desc("verbosity"), init(0), cat(C));
|
opt<int> opt_verbose("v", desc("verbosity, from -3 (fatal) to 2 (verbose)"),
|
||||||
|
init(0), cat(C));
|
||||||
opt<std::string> opt_test_index("test-index", ValueOptional, init("!"),
|
opt<std::string> opt_test_index("test-index", ValueOptional, init("!"),
|
||||||
desc("run index tests"), cat(C));
|
desc("run index tests"), cat(C));
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ bool CacheInvalid(VFS *vfs, IndexFile *prev, const std::string &path,
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(vfs->mutex);
|
std::lock_guard<std::mutex> lock(vfs->mutex);
|
||||||
if (prev->mtime < vfs->state[path].timestamp) {
|
if (prev->mtime < vfs->state[path].timestamp) {
|
||||||
LOG_S(INFO) << "timestamp changed for " << path
|
LOG_V(1) << "timestamp changed for " << path
|
||||||
<< (from ? " (via " + *from + ")" : std::string());
|
<< (from ? " (via " + *from + ")" : std::string());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -131,8 +131,8 @@ bool CacheInvalid(VFS *vfs, IndexFile *prev, const std::string &path,
|
|||||||
if (strcmp(prev->args[i], args[i]) && sys::path::stem(args[i]) != stem)
|
if (strcmp(prev->args[i], args[i]) && sys::path::stem(args[i]) != stem)
|
||||||
changed = true;
|
changed = true;
|
||||||
if (changed)
|
if (changed)
|
||||||
LOG_S(INFO) << "args changed for " << path
|
LOG_V(1) << "args changed for " << path
|
||||||
<< (from ? " (via " + *from + ")" : std::string());
|
<< (from ? " (via " + *from + ")" : std::string());
|
||||||
return changed;
|
return changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -262,10 +262,14 @@ bool Indexer_Parse(SemaManager *completion, WorkingFiles *wfiles,
|
|||||||
if (auto mtime1 = LastWriteTime(dep.first.val().str())) {
|
if (auto mtime1 = LastWriteTime(dep.first.val().str())) {
|
||||||
if (dep.second < *mtime1) {
|
if (dep.second < *mtime1) {
|
||||||
reparse = 2;
|
reparse = 2;
|
||||||
|
LOG_V(1) << "timestamp changed for " << path_to_index << " via "
|
||||||
|
<< dep.first.val().str();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
reparse = 2;
|
reparse = 2;
|
||||||
|
LOG_V(1) << "timestamp changed for " << path_to_index << " via "
|
||||||
|
<< dep.first.val().str();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -525,6 +529,10 @@ void LaunchStdin() {
|
|||||||
std::string method;
|
std::string method;
|
||||||
ReflectMember(reader, "id", id);
|
ReflectMember(reader, "id", id);
|
||||||
ReflectMember(reader, "method", method);
|
ReflectMember(reader, "method", method);
|
||||||
|
if (id.Valid())
|
||||||
|
LOG_V(2) << "receive RequestMessage: " << id.value << " " << method;
|
||||||
|
else
|
||||||
|
LOG_V(2) << "receive NotificationMessage " << method;
|
||||||
if (method.empty())
|
if (method.empty())
|
||||||
continue;
|
continue;
|
||||||
bool should_exit = method == "exit";
|
bool should_exit = method == "exit";
|
||||||
@ -738,6 +746,7 @@ void NotifyOrRequest(const char *method, bool request,
|
|||||||
JsonWriter writer(&w);
|
JsonWriter writer(&w);
|
||||||
fn(writer);
|
fn(writer);
|
||||||
w.EndObject();
|
w.EndObject();
|
||||||
|
LOG_V(2) << (request ? "RequestMessage: " : "NotificationMessage: ") << method;
|
||||||
for_stdout->PushBack(output.GetString());
|
for_stdout->PushBack(output.GetString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,6 +774,8 @@ static void Reply(RequestId id, const char *key,
|
|||||||
JsonWriter writer(&w);
|
JsonWriter writer(&w);
|
||||||
fn(writer);
|
fn(writer);
|
||||||
w.EndObject();
|
w.EndObject();
|
||||||
|
if (id.Valid())
|
||||||
|
LOG_V(2) << "respond to RequestMessage: " << id.value;
|
||||||
for_stdout->PushBack(output.GetString());
|
for_stdout->PushBack(output.GetString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user