PHP Класс Autarky\Logging\ChannelManager

Наследование: extends Psr\Log\AbstractLogger, implements Psr\Log\LoggerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$channels Psr\Log\LoggerInterface[] The defined channels.
$defaultChannel string The name of the default channel to use.
$deferredChannels callable[] The deferred channel callbacks.

Открытые методы

Метод Описание
__construct ( string $defaultChannel = 'default' ) Constructor.
getChannel ( string $channel = null ) : Psr\Log\LoggerInterface Get a specific channel.
getDefaultChannelName ( ) : string Get the name of the default channel.
log ( $level, $message, array $context = [] )
setChannel ( string $channel, Psr\Log\LoggerInterface $logger ) Set a channel instance.
setDefaultChannel ( string $channel ) Change the default channel.
setDeferredChannel ( string $channel, callable $callback ) Define a deferred channel. The callback will be invoked and the return value passed to setChannel. The return value must implement Psr\Log\LoggerInterface.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( string $defaultChannel = 'default' )
$defaultChannel string

getChannel() публичный метод

Get a specific channel.
public getChannel ( string $channel = null ) : Psr\Log\LoggerInterface
$channel string Optional - if none, use default channel
Результат Psr\Log\LoggerInterface

getDefaultChannelName() публичный метод

Get the name of the default channel.
public getDefaultChannelName ( ) : string
Результат string

log() публичный метод

public log ( $level, $message, array $context = [] )
$context array

setChannel() публичный метод

Set a channel instance.
public setChannel ( string $channel, Psr\Log\LoggerInterface $logger )
$channel string
$logger Psr\Log\LoggerInterface

setDefaultChannel() публичный метод

Change the default channel.
public setDefaultChannel ( string $channel )
$channel string

setDeferredChannel() публичный метод

Define a deferred channel. The callback will be invoked and the return value passed to setChannel. The return value must implement Psr\Log\LoggerInterface.
public setDeferredChannel ( string $channel, callable $callback )
$channel string
$callback callable Callback that takes no arguments

Описание свойств

$channels защищенное свойство

The defined channels.
protected LoggerInterface[],Psr\Log $channels
Результат Psr\Log\LoggerInterface[]

$defaultChannel защищенное свойство

The name of the default channel to use.
protected string $defaultChannel
Результат string

$deferredChannels защищенное свойство

The deferred channel callbacks.
protected callable[] $deferredChannels
Результат callable[]