Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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.

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