MDL-49399 task: Add admin log viewer

AMOS BEGIN
 CPY [eventstarttime,core_calendar],[task_starttime,core_admin]
 CPY [eventduration,core_calendar],[task_duration,core_admin]
 CPY [result,core_cache],[task_result,core_admin]
 CPY [database,install],[task_dbstats,core_admin]
 CPY [fail,install],[task_result:failed,core_admin]
AMOS END
This commit is contained in:
Andrew Nicols
2019-01-16 12:14:25 +08:00
parent 4b71596fc9
commit 8c69e86cd4
12 changed files with 508 additions and 7 deletions
+23
View File
@@ -84,6 +84,29 @@ class database_logger implements task_logger {
$logdata->id = $DB->insert_record('task_log', $logdata);
}
/**
* Whether this task logger has a report available.
*
* @return bool
*/
public static function has_log_report() : bool {
return true;
}
/**
* Get any URL available for viewing relevant task log reports.
*
* @param string $classname The task class to fetch for
* @return \moodle_url
*/
public static function get_url_for_task_class(string $classname) : \moodle_url {
global $CFG;
return new \moodle_url("/{$CFG->admin}/tasklogs.php", [
'filter' => $classname,
]);
}
/**
* Cleanup old task logs.
*/