Skip to content

Commit

Permalink
Bug SAFeSEA#32, PHP fixes for EssayAnalyser [iet:10299633][ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed Feb 5, 2018
1 parent 24f1538 commit b816ff5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/controllers/user.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function submitDraft($taskId)

self::_debug([ __METHOD__, 'Requests except', 500.2, $e->getMessage() ]);

$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Requests', $username, 'ip', $req->getPath, $e->getMessage() ));
$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Requests', $username, 'ip', $req->getPath(), $e->getMessage() ));
}
catch (\PDOException $e)
{
Expand All @@ -312,7 +312,7 @@ public function submitDraft($taskId)

self::_debug([ __METHOD__, 'PDO except', 500.3, $e->getMessage() ]);

$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.PDO', $username, 'ip', $req->getPath, $e->getMessage() ));
$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.PDO', $username, 'ip', $req->getPath(), $e->getMessage() ));
}
catch (\Exception $ex)
{
Expand All @@ -321,7 +321,7 @@ public function submitDraft($taskId)

self::_debug([ __METHOD__, 'except', 500.4, $ex->getMessage(), get_class( $ex ) ]);

$log->error(sprintf( '%s | [%s @ %s] | %s | %s | %s', 'ANALYSER.Unknown', $username, 'ip', $req->getPath, $ex->getMessage(), get_class( $ex ) ));
$log->error(sprintf( '%s | [%s @ %s] | %s | %s | %s', 'ANALYSER.Unknown', $username, 'ip', $req->getPath(), $ex->getMessage(), get_class( $ex ) ));

// X-app-03: [ "UserController::submitDraft", "except", 500.4, "", "Slim\\Exception\\Stop" ]
}
Expand Down
4 changes: 2 additions & 2 deletions app/utils/EssayAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function analyseAndSave( $taskId, $user )
$draftId = $result->db_result->draft_id;
self::_debug([ 'm' => __METHOD__, 'ok', 'u' => $url, 'taskId' => $taskId, 'draftVersion' => $versionId, 'result' => $result, 'duration_sec' => $times->duration, 'counts' => $counts ]);

$log->info(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Saved', $username, 'ip', $req->getPath, json_encode([ 'task' => $taskId, 'ver' => $versionId, 'draft' => $draftId ]) ));
$log->info(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Saved', $username, 'ip', $req->getPath(), json_encode([ 'task' => $taskId, 'ver' => $versionId, 'draft' => $draftId ]) ));

$result->status = 200;
$result->redirect = true;
Expand All @@ -110,7 +110,7 @@ public function analyseAndSave( $taskId, $user )
self::_debug([ __METHOD__, 'error', 500.1, $ret ]);

// $log->info(sprintf('%s | [%s @ %s] | %s | %s', 'ACTION.SAMS_CREATE', $usr->username, $usr->ip_address, $req->getPath(), json_encode([ 'user_agent' => $req->getUserAgent() ]) ));
$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Analyser', $username, 'ip', $req->getPath, json_encode( $ret ) ));
$log->error(sprintf( '%s | [%s @ %s] | %s | %s', 'ANALYSER.Analyser', $username, 'ip', $req->getPath(), json_encode( $ret ) ));
}

return $result;
Expand Down

0 comments on commit b816ff5

Please sign in to comment.