PHP Class Autarky\Logging\ChannelManager

Inheritance: extends Psr\Log\AbstractLogger, implements Psr\Log\LoggerInterface
Afficher le fichier Open project: autarky/framework Class Usage Examples

Protected Properties

Свойство Type Description
$channels Psr\Log\LoggerInterface[] The defined channels.
$defaultChannel string The name of the default channel to use.
$deferredChannels callable[] The deferred channel callbacks.

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

getChannel() public méthode

Get a specific channel.
public getChannel ( string $channel = null ) : Psr\Log\LoggerInterface
$channel string Optional - if none, use default channel
Résultat Psr\Log\LoggerInterface

getDefaultChannelName() public méthode

Get the name of the default channel.
public getDefaultChannelName ( ) : string
Résultat string

log() public méthode

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

setChannel() public méthode

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

setDefaultChannel() public méthode

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

setDeferredChannel() public méthode

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

Property Details

$channels protected_oe property

The defined channels.
protected LoggerInterface[],Psr\Log $channels
Résultat Psr\Log\LoggerInterface[]

$defaultChannel protected_oe property

The name of the default channel to use.
protected string $defaultChannel
Résultat string

$deferredChannels protected_oe property

The deferred channel callbacks.
protected callable[] $deferredChannels
Résultat callable[]