Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Interface for task logging.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 71 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

task_logger:: (4 methods):
  is_configured()
  store_log_for_task()
  has_log_report()
  get_url_for_task_class()


Interface: task_logger  - X-Ref

Interface for task logging.

is_configured()   X-Ref
Whether the task is configured and ready to log.

return: bool

store_log_for_task(task_base $task, string $logpath, bool $failed,int $dbreads, int $dbwrites, float $timestart, float $timeend)   X-Ref
Store the log for the specified task.

param: task_base   $task The task that the log belongs to.
param: string      $logpath The path to the log on disk
param: bool        $failed Whether the task failed
param: int         $dbreads The number of DB reads
param: int         $dbwrites The number of DB writes
param: float       $timestart The start time of the task
param: float       $timeend The end time of the task

has_log_report()   X-Ref
Whether this task logger has a report available.

return: bool

get_url_for_task_class(string $classname)   X-Ref
Get any URL available for viewing relevant task log reports.

return: \moodle_url
param: string      $classname The task class to fetch for