Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
PhpXmlRpc\Helper\Logger Class Reference

Public Member Functions

 debug ($message, $context=array())
 NB: unlike other "traditional" loggers, this one echoes to screen the debug messages instead of logging them.
 
 debugMessage ($message, $encoding=null)
 Echoes a debug message, taking care of escaping it when not in console mode.
 
 error ($message, $context=array())
 Triggers the writing of a message to php's error log.
 
 errorLog ($message)
 Writes a message to the error log.
 
 warning ($message, $context=array())
 Following the general principle of 'never break stdout', the default behaviour.
 

Static Public Member Functions

static instance ()
 This class can be used as singleton, so that later we can move to DI patterns (ish...)
 

Static Protected Attributes

static $instance = null
 

Member Function Documentation

◆ debug()

PhpXmlRpc\Helper\Logger::debug ( $message,
$context = array() )

NB: unlike other "traditional" loggers, this one echoes to screen the debug messages instead of logging them.

Parameters
string$message
array$contextknown key: 'encoding'
Return values
void

◆ debugMessage()

PhpXmlRpc\Helper\Logger::debugMessage ( $message,
$encoding = null )

Echoes a debug message, taking care of escaping it when not in console mode.

NB: if the encoding of the message is not known or wrong, and we are working in web mode, there is no guarantee of 100% accuracy, which kind of defeats the purpose of debugging

Parameters
string$message
string$encodingdeprecated
Return values
void

◆ error()

PhpXmlRpc\Helper\Logger::error ( $message,
$context = array() )

Triggers the writing of a message to php's error log.

Parameters
string$message
array$context
Return values
void

◆ errorLog()

PhpXmlRpc\Helper\Logger::errorLog ( $message)

Writes a message to the error log.

Parameters
string$message
Return values
void

◆ instance()

static PhpXmlRpc\Helper\Logger::instance ( )
static

This class can be used as singleton, so that later we can move to DI patterns (ish...)

Return values
Logger

◆ warning()

PhpXmlRpc\Helper\Logger::warning ( $message,
$context = array() )

Following the general principle of 'never break stdout', the default behaviour.

Parameters
string$message
$context
Return values
void

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