LogMux
in package
implements
ILogger
Log multiplexer. Allows writing to multiple logs simultaneously.
Table of Contents
Interfaces
- ILogger
- Logger interface.
Properties
- $_logs : array<string|int, mixed>
- $_runLevel : RunLevel
- $channel : string|null
Methods
- addFilter() : bool
- Add a filter to all attached loggers destinations.
- addLog() : void
- alert() : void
- critical() : void
- debug() : void
- emergency() : void
- error() : void
- getChannel() : string|null
- Get the channel name for this LogMux.
- getContext() : array<string|int, mixed>
- Returns an array of all contexts.
- getLogs() : array<string|int, mixed>
- Returns an array of all attached loggers.
- getRunLevel() : RunLevel
- info() : void
- log() : void
- notice() : void
- removeFilter() : bool
- Removes a filter from all attached loggers destinations.
- reset() : void
- Clears all attached loggers.
- setChannel() : void
- Set the channel name for this LogMux and all attached loggers.
- setContext() : void
- Adds context for all loggers.
- setRunLevel() : void
- Sync run levels for all loggers.
- setRunLevelText() : void
- Sets the run level by text.
- warning() : void
Properties
$_logs
private
array<string|int, mixed>
$_logs
= []
$_runLevel
private
RunLevel
$_runLevel
= \Neuron\Log\RunLevel::DEBUG
$channel
private
string|null
$channel
= null
Methods
addFilter()
Add a filter to all attached loggers destinations.
public
addFilter(IFilter $filter) : bool
Parameters
- $filter : IFilter
Return values
booladdLog()
public
addLog(ILogger $log) : void
Parameters
- $log : ILogger
Return values
void —Adds a logger.
alert()
public
alert(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
critical()
public
critical(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
debug()
public
debug(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
emergency()
public
emergency(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
error()
public
error(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
getChannel()
Get the channel name for this LogMux.
public
getChannel() : string|null
Return values
string|nullgetContext()
Returns an array of all contexts.
public
getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>getLogs()
Returns an array of all attached loggers.
public
getLogs() : array<string|int, mixed>
Return values
array<string|int, mixed>getRunLevel()
public
getRunLevel() : RunLevel
Return values
RunLevelinfo()
public
info(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
log()
public
log(string $text, RunLevel $level[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $level : RunLevel
- $context : array<string|int, mixed> = []
notice()
public
notice(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []
removeFilter()
Removes a filter from all attached loggers destinations.
public
removeFilter(IFilter $filter) : bool
Parameters
- $filter : IFilter
Return values
boolreset()
Clears all attached loggers.
public
reset() : void
setChannel()
Set the channel name for this LogMux and all attached loggers.
public
setChannel(string|null $channel) : void
Parameters
- $channel : string|null
setContext()
Adds context for all loggers.
public
setContext(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
setRunLevel()
Sync run levels for all loggers.
public
setRunLevel(mixed $level) : void
Parameters
- $level : mixed
setRunLevelText()
Sets the run level by text.
public
setRunLevelText(string $level) : void
Valid values are: debug, info, notice, warning, error, critical, alert, emergency
Parameters
- $level : string
warning()
public
warning(string $text[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $text : string
- $context : array<string|int, mixed> = []