Class ColoredIndentedLogger
PSR-3 logger for adding colors and indentation on PHP CLI output.
Use tags and placeholder syntax to provide an easy way to color and indent PHP CLI output. PSR-3 compatibility allows graceful degradation when switching to another PSR-3 compliant logger. See README.md for more information.
Copyright (c) 2013 Geoffroy Aubry <geoffroy.aubry@free.fr> Licensed under the GNU Lesser General Public License v3 (LGPL version 3).
- Psr\Log\AbstractLogger implements Psr\Log\LoggerInterface
- GAubry\Logger\AbstractLogger
- GAubry\Logger\ColoredIndentedLogger
Copyright: 2013 Geoffroy Aubry <geoffroy.aubry@free.fr>
License: http://www.gnu.org/licenses/lgpl.html
See: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
Located at logger/src/GAubry/Logger/ColoredIndentedLogger.php
public
|
|
private
|
|
private
string
|
#
processLeadingIndentationTags( string $sMessage )
Update indentation level according to leading indentation tags and remove them from the returned string. |
private
string
|
#
processTrailingIndentationTags( string $sMessage )
Update indentation level according to trailing indentation tags and remove them from the returned string. |
public
null
|
checkMsgLevel(),
interpolateContext()
|
alert(),
critical(),
debug(),
emergency(),
error(),
info(),
notice(),
warning()
|
private
integer
|
$iIndentTagLength |
|
#
Length of the indent tag. |
private
integer
|
$iUnindentTagLength |
|
#
Length of the unindent tag. |
private
integer
|
$iIndentationLevel |
|
#
Current zero-based indentation level. |
private
array
|
$aColorTags |
|
#
Full length color tags combining prefix to user define colors. |
private static
array
|
$aDefaultConfig | array(
'colors' => array(),
'base_indentation' => "\033[0;30m┆\033[0m ",
'indent_tag' => '+++',
'unindent_tag' => '---',
'min_message_level' => LogLevel::DEBUG,
'reset_color_sequence' => "\033[0m",
'color_tag_prefix' => 'C.'
) |
#
Default configuration. |
private
array
|
$aConfig |
|
#
Current configuration. |
$aIntLevels,
$iMinMsgLevel
|