class Reporter (View source)

Multi-logger reporter

Traits

Singleton pattern trait

Methods

static $this
getInstance()

Get the class singleton instance

registerLogger(string $key, LoggerInterface $logger)

Add a replace a logger.

unregisterLogger(string $key)

Remove a logger by its key

__call(string $method, array $args)

Invoke registered loggers corresponding method

static mixed
__callStatic(string $method, array $args)

Invoke the corresponding method on all loggers registered to the Reporter default instance.

__construct()

No description

Details

static $this getInstance()

Get the class singleton instance

Return Value

$this Class singleton instance. If the singleton was not created yet, the instance will be created by calling the class constructor with the arguments given to the getInstance() method

registerLogger(string $key, LoggerInterface $logger)

Add a replace a logger.

This method is also callable statically. In this case, the class singleton will be used.

Parameters

string $key Logger identifier
LoggerInterface $logger

unregisterLogger(string $key)

Remove a logger by its key

This method is also callable statically. In this case, the class singleton will be used.

Parameters

string $key Logger identifier

__call(string $method, array $args)

Invoke registered loggers corresponding method

Parameters

string $method Loggers method ton invoke
array $args Loggers method arguments

Exceptions

BadMethodCallException

static mixed __callStatic(string $method, array $args)

Invoke the corresponding method on all loggers registered to the Reporter default instance.

Parameters

string $method Method name
array $args Method arguments

Return Value

mixed

__construct()