updte cron log format when output is empty or big

This commit is contained in:
aaronchen2k
2020-01-16 15:23:50 +08:00
parent fb7a45efe3
commit 341171bf1a
5 changed files with 18 additions and 22 deletions
+6
View File
@@ -221,6 +221,12 @@ class cron extends control
/* Save log. */
$log = '';
$time = $now->format('G:i:s');
if (empty($output)) {
$output = '\n';
}
if (count($output) > 100) { // return if output a lot of info
$output = "\n" . $output;
}
$log = "$time task " . $id . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $output\n";
$this->cron->logCron($log);
unset($log);