Skip to content

Commit 7e8e592

Browse files
committed
fix(debug): use comma-separated LOG args instead of << operator
LOG macro uses QTextStream fold expression, not ostream <<. toStdString() temporaries in << chains cause compile errors on MSVC.
1 parent 1f1b28b commit 7e8e592

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

src/core/taskjudger.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ auto TaskJudger::traditionalTaskPrepare() -> bool {
279279
compilerProcess.kill();
280280
compilerProcess.waitForFinished(3000);
281281
compileState = CompileTimeLimitExceeded;
282-
LOG("traditionalTaskPrepare: compile TIMEOUT for "
283-
<< contestantName.toStdString());
282+
LOG("traditionalTaskPrepare: compile TIMEOUT for", contestantName);
284283
} else if (compilerProcess.exitCode() != 0) {
285284
compileState = CompileError;
286285
compileMessage =
@@ -324,9 +323,8 @@ auto TaskJudger::traditionalTaskPrepare() -> bool {
324323
}
325324

326325
if (compileState != CompileSuccessfully) {
327-
LOG("traditionalTaskPrepare FAILED: compileState=" << static_cast<int>(compileState)
328-
<< " contestant=" << contestant->getContestantName().toStdString()
329-
<< " task=" << task->getProblemTitle().toStdString());
326+
LOG("traditionalTaskPrepare FAILED: compileState=", static_cast<int>(compileState),
327+
"contestant=", contestant->getContestantName(), "task=", task->getProblemTitle());
330328
emit compileError(task->getTotalTimeLimit(), static_cast<int>(compileState));
331329
return false;
332330
}
@@ -338,11 +336,9 @@ void TaskJudger::judgeIt() {
338336
qDebug() << "Start Judging";
339337
emit judgingStarted(task->getProblemTitle());
340338
int judgeResult = judge();
341-
LOG("judgeIt: contestant=" << contestant->getContestantName().toStdString()
342-
<< " task=" << task->getProblemTitle().toStdString()
343-
<< " judge()=" << judgeResult
344-
<< " compileState=" << static_cast<int>(compileState)
345-
<< " result.size()=" << result.size());
339+
LOG("judgeIt: contestant=", contestant->getContestantName(), "task=", task->getProblemTitle(),
340+
"judge()=", judgeResult, "compileState=", static_cast<int>(compileState),
341+
"result.size()=", result.size());
346342
if (judgeResult) {
347343
contestant->setCheckJudged(taskId, true);
348344
contestant->setCompileMessage(taskId, compileMessage);
@@ -368,11 +364,10 @@ int TaskJudger::judge() {
368364

369365
if (task->getTaskType() != Task::AnswersOnly)
370366
if (! traditionalTaskPrepare()) {
371-
LOG("judge: traditionalTaskPrepare FAILED for contestant="
372-
<< contestant->getContestantName().toStdString()
373-
<< " task=" << task->getProblemTitle().toStdString()
374-
<< " compileState=" << static_cast<int>(compileState)
375-
<< " result.size()=" << result.size());
367+
LOG("judge: traditionalTaskPrepare FAILED for contestant=",
368+
contestant->getContestantName(), "task=", task->getProblemTitle(),
369+
"compileState=", static_cast<int>(compileState),
370+
"result.size()=", result.size());
376371
return 1;
377372
}
378373

0 commit comments

Comments
 (0)