Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core\task\logmanager Class Reference

Task log manager. More...

Static Public Member Functions

static add_line (string $log)
 Add a log record to the task log.
 
static finalise_log (bool $failed=false)
 Finish writing for the current task.
 
static flush ()
 Flush the current output buffer.
 
static get_logger_classname ()
 Return the name of the logging class to use.
 
static get_url_for_task_class (string $classname)
 Get any URL available for viewing relevant task log reports.
 
static has_log_report ()
 Whether this task logger has a report available.
 
static start_logging (task_base $task)
 Create a new task logger for the specified task, and prepare for logging.
 
static uses_standard_settings ()
 Whether to use the standard settings form.
 

Public Attributes

int const CHUNKSIZE = 1
 The default chunksize to use in ob_start.
 
int const MODE_ALL = 1
 Log all tasks.
 
int const MODE_FAILONLY = 2
 Only log fails.
 
int const MODE_NONE = 0
 Do not log anything.
 

Static Protected Member Functions

static is_capturing ()
 Whether we are capturing at all.
 
static is_current_output_buffer ()
 Whether we are the current log collector.
 
static should_log ()
 Whether logging is possible and should be happening.
 

Static Protected Attributes

static resource $fh = null
 The current filehandle used for logging.
 
static string $logpath = null
 The path to the log file.
 
static int $oblevel = null
 The level of output buffering in place before starting.
 
static bool $outputloggedcontent = true
 Output logged content to screen.
 
static core task task_base $task = null
 The task being logged.
 
static stdClass $taskloginfo = null
 Metadata about the current log.
 
static bool $tasklogregistered = false
 Whether the task logger has been registered with the shutdown handler.
 

Detailed Description

Task log manager.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_line()

static core\task\logmanager::add_line ( string $log)
static

Add a log record to the task log.

Parameters
string$log
Return values
string

◆ finalise_log()

static core\task\logmanager::finalise_log ( bool $failed = false)
static

Finish writing for the current task.

Parameters
bool$failed

◆ flush()

static core\task\logmanager::flush ( )
static

Flush the current output buffer.

This function will ensure that we are the current output buffer handler.

◆ get_logger_classname()

static core\task\logmanager::get_logger_classname ( )
static

Return the name of the logging class to use.

Return values
string

◆ get_url_for_task_class()

static core\task\logmanager::get_url_for_task_class ( string $classname)
static

Get any URL available for viewing relevant task log reports.

Parameters
string$classnameThe task class to fetch for
Return values
moodle_url

◆ has_log_report()

static core\task\logmanager::has_log_report ( )
static

Whether this task logger has a report available.

Return values
bool

◆ is_capturing()

static core\task\logmanager::is_capturing ( )
staticprotected

Whether we are capturing at all.

Return values
bool

◆ is_current_output_buffer()

static core\task\logmanager::is_current_output_buffer ( )
staticprotected

Whether we are the current log collector.

Return values
bool

◆ should_log()

static core\task\logmanager::should_log ( )
staticprotected

Whether logging is possible and should be happening.

Return values
bool

◆ start_logging()

static core\task\logmanager::start_logging ( task_base $task)
static

Create a new task logger for the specified task, and prepare for logging.

Parameters
core\task\task_base$taskThe task being run

The documentation for this class was generated from the following file: