MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / saveLog

Method saveLog

Components/LogDialog.cpp:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void
47LogDialog::saveLog(QString path)
48{
49 FILE *fp;
50
51 if ((fp = fopen(path.toStdString().c_str(), "w")) == nullptr) {
52 QString error(errno);
53
54 QMessageBox::critical(
55 this,
56 "Save message log",
57 "Failed to save message log to file: " + error + "\n\n");
58 return;
59 }
60
61 for (int i = 0; i < this->msgVec.size(); ++i) {
62 fprintf(
63 fp,
64 "%ld.%d,%s,%s,%s:%d,%s",
65 this->msgVec[i].time.tv_sec,
66 static_cast<int>(this->msgVec[i].time.tv_usec),
67 su_log_severity_to_string(this->msgVec[i].severity),
68 this->msgVec[i].domain.c_str(),
69 this->msgVec[i].function.c_str(),
70 this->msgVec[i].line,
71 this->msgVec[i].message.c_str());
72 }
73
74 fclose(fp);
75}
76
77void
78LogDialog::connectAll(void)

Callers 1

onSaveMethod · 0.95

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected