PHP Class CacheTool\Monolog\ConsoleHandler
It is disabled by default and gets activated as soon as a command is executed.
Instead of listening to the console events, the output can also be set manually.
The minimum logging level at which this handler will be triggered depends on the
verbosity setting of the console output. The default mapping is:
- OutputInterface::VERBOSITY_NORMAL will show all WARNING and higher logs
- OutputInterface::VERBOSITY_VERBOSE (-v) will show all NOTICE and higher logs
- OutputInterface::VERBOSITY_VERY_VERBOSE (-vv) will show all INFO and higher logs
- OutputInterface::VERBOSITY_DEBUG (-vvv) will show all DEBUG and higher logs, i.e. all logs
This mapping can be customized with the $verbosityLevelMap constructor parameter.
Show file
Open project: gordalina/cachetool
Class Usage Examples
Public Methods
Method |
Description |
|
__construct ( Symfony\Component\Console\Output\OutputInterface $output = null, boolean $bubble = true, array $verbosityLevelMap = [] ) |
Constructor. |
|
close ( ) |
Disables the output. |
|
handle ( array $record ) |
|
|
isHandling ( array $record ) |
|
|
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) |
Sets the console output to use for printing logs. |
|
Protected Methods
Private Methods
Method |
Description |
|
updateLevel ( ) : boolean |
Updates the logging level based on the verbosity setting of the console output. |
|
Method Details
__construct()
public method
public __construct ( Symfony\Component\Console\Output\OutputInterface $output = null, boolean $bubble = true, array $verbosityLevelMap = [] ) |
$output |
Symfony\Component\Console\Output\OutputInterface |
The console output to use (the handler remains disabled when passing null
until the output is set, e.g. by using console events) |
$bubble |
boolean |
Whether the messages that are handled can bubble up the stack |
$verbosityLevelMap |
array |
Array that maps the OutputInterface verbosity to a minimum logging
level (leave empty to use the default mapping) |
isHandling()
public method
setOutput()
public method
Sets the console output to use for printing logs.
public setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) |
$output |
Symfony\Component\Console\Output\OutputInterface |
The console output to use |