ENH: rename tracked crash log
Change-Id: I60d1c1af873c60776334f26503e22230bb541e0a
This commit is contained in:
parent
fddd101685
commit
02fbd88150
|
@ -1141,6 +1141,7 @@ void GUI_App::post_init()
|
||||||
{
|
{
|
||||||
std::string file_name = iter->path().stem().string();
|
std::string file_name = iter->path().stem().string();
|
||||||
if (boost::starts_with(file_name, "crash")) {
|
if (boost::starts_with(file_name, "crash")) {
|
||||||
|
if (file_name.find("done") == std::string::npos) {
|
||||||
std::ifstream ifs(iter->path().string(), ios::in);
|
std::ifstream ifs(iter->path().string(), ios::in);
|
||||||
std::stringstream data;
|
std::stringstream data;
|
||||||
data << ifs.rdbuf();
|
data << ifs.rdbuf();
|
||||||
|
@ -1153,13 +1154,16 @@ void GUI_App::post_init()
|
||||||
j["content"] = decode_path(data.str().c_str());
|
j["content"] = decode_path(data.str().c_str());
|
||||||
try {
|
try {
|
||||||
if (agent) {
|
if (agent) {
|
||||||
agent->track_event("studio_crash", j.dump()); }
|
agent->track_event("studio_crash", j.dump());
|
||||||
} catch (...) {}
|
}
|
||||||
std::string new_file_name = file_name.insert(0, "_done_");
|
}
|
||||||
|
catch (...) {}
|
||||||
|
std::string new_file_name = file_name.append("_done");
|
||||||
boost::filesystem::rename(iter->path(), iter->path().parent_path() / boost::filesystem::path(new_file_name + iter->path().extension().string()));
|
boost::filesystem::rename(iter->path(), iter->path().parent_path() / boost::filesystem::path(new_file_name + iter->path().extension().string()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_networking_need_update) {
|
if (m_networking_need_update) {
|
||||||
//updating networking
|
//updating networking
|
||||||
|
|
Loading…
Reference in New Issue