PHP Class Elgg\Logger

Use the elgg_* versions instead.
Since: 1.9.0
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Protected Properties

Свойство Type Description
$display Display to user?
$hooks PluginHooksService
$level The logging level
$levels

Méthodes publiques

Méthode Description
__construct ( PluginHooksService $hooks, Config $config, elgg\Context $context ) Constructor
disable ( ) : void Temporarily disable logging and capture logs (before tests)
dump ( mixed $data, boolean $display = true ) : void Dump data to log or screen
enable ( ) : array Restore logging and get record of log calls (after tests)
error ( string $message ) : boolean Log message at the ERROR level
getLevel ( ) : integer Get the current logging level
info ( string $message ) : boolean Log message at the INFO level
log ( string $message, integer $level = self::NOTICE ) : boolean Add a message to the log
notice ( string $message ) : boolean Log message at the NOTICE level
setDisplay ( boolean $display ) : void Set whether the logging should be displayed to the user
setHooks ( PluginHooksService $hooks ) : void Reset the hooks service for this instance (testing)
setLevel ( integer $level ) : void Set the logging level
warn ( string $message ) : boolean Log message at the WARNING level

Méthodes protégées

Méthode Description
process ( mixed $data, boolean $display, integer $level ) : void Process logging data

Method Details

__construct() public méthode

Constructor
public __construct ( PluginHooksService $hooks, Config $config, elgg\Context $context )
$hooks PluginHooksService Hooks service
$config Config Config service
$context elgg\Context Context service

disable() public méthode

Call disable() before your tests and enable() after. enable() will return a list of calls to log() (and helper methods) that were not acted upon.
See also: enable
public disable ( ) : void
Résultat void

dump() public méthode

Dump data to log or screen
public dump ( mixed $data, boolean $display = true ) : void
$data mixed The data to log
$display boolean Whether to include this in the HTML page
Résultat void

enable() public méthode

Restore logging and get record of log calls (after tests)
See also: disable
public enable ( ) : array
Résultat array

error() public méthode

Log message at the ERROR level
public error ( string $message ) : boolean
$message string The message to log
Résultat boolean

getLevel() public méthode

Get the current logging level
public getLevel ( ) : integer
Résultat integer

info() public méthode

Log message at the INFO level
public info ( string $message ) : boolean
$message string The message to log
Résultat boolean

log() public méthode

Add a message to the log
public log ( string $message, integer $level = self::NOTICE ) : boolean
$message string The message to log
$level integer The logging level
Résultat boolean Whether the messages was logged

notice() public méthode

Log message at the NOTICE level
public notice ( string $message ) : boolean
$message string The message to log
Résultat boolean

process() protected méthode

Process logging data
protected process ( mixed $data, boolean $display, integer $level ) : void
$data mixed The data to process
$display boolean Whether to display the data to the user. Otherwise log it.
$level integer The logging level for this data
Résultat void

setDisplay() public méthode

Whether data is actually displayed to the user depends on this setting and other factors such as whether we are generating a JavaScript or CSS file.
public setDisplay ( boolean $display ) : void
$display boolean Whether to display logging
Résultat void

setHooks() public méthode

Reset the hooks service for this instance (testing)
public setHooks ( PluginHooksService $hooks ) : void
$hooks PluginHooksService
Résultat void

setLevel() public méthode

Set the logging level
public setLevel ( integer $level ) : void
$level integer The logging level
Résultat void

warn() public méthode

Log message at the WARNING level
public warn ( string $message ) : boolean
$message string The message to log
Résultat boolean

Property Details

$display protected_oe property

Display to user?
protected $display

$hooks protected_oe property

protected PluginHooksService,elgg $hooks
Résultat PluginHooksService

$level protected_oe property

The logging level
protected $level

$levels protected_oe static_oe property

protected static $levels