Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
base_logger Class Reference

Base abstract class for all the loggers to be used in backup/restore. More...

Inheritance diagram for base_logger:
checksumable core_backup_html_logger database_logger error_log_logger file_logger output_indented_logger output_text_logger

Public Member Functions

 __construct ($level, $showdate=false, $showlevel=false)
 
 calculate_checksum ()
 This function will return one unique and stable checksum for one instance of the class implementing it.
 
 close ()
 Close any resource the logger may have open.
 
 destroy ()
 Destroy (nullify) the chain of loggers references, also closing resources when needed.
 
 get_level ()
 
 get_next ()
 
 is_checksum_correct ($checksum)
 Given one checksum, returns if matches object's checksum (true) or no (false)
 
 process ($message, $level, $options=null)
 
 set_next ($next)
 

Protected Member Functions

 action ($message, $level, $options=null)
 
 get_datestr ()
 
 get_levelstr ($level)
 
 get_nexts ()
 
 get_prefix ($level, $options)
 
 is_circular_reference ($obj)
 

Protected Attributes

 $level
 
 $next
 
 $showdate
 
 $showlevel
 

Detailed Description

Base abstract class for all the loggers to be used in backup/restore.

Any message passed will be processed by all the loggers in the defined chain (note some implementations may be not strictly "loggers" but classes performing other sort of tasks (avoiding browser/php timeouts, painters...). One simple 1-way basic chain of commands/responsibility pattern.

TODO: Finish phpdocs

Member Function Documentation

◆ calculate_checksum()

base_logger::calculate_checksum ( )

This function will return one unique and stable checksum for one instance of the class implementing it.

It's each implementation responsibility to do it recursively if needed and use optional store (caching) of the checksum if necessary/possible

Implements checksumable.

◆ close()

base_logger::close ( )

Close any resource the logger may have open.

Since
Moodle 3.1

Reimplemented in file_logger.

◆ destroy()

base_logger::destroy ( )
final

Destroy (nullify) the chain of loggers references, also closing resources when needed.

Since
Moodle 3.1

◆ is_checksum_correct()

base_logger::is_checksum_correct ( $checksum)

Given one checksum, returns if matches object's checksum (true) or no (false)

Implements checksumable.


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