ConsoleLoggerCreator
namespace |
bhenk\logger\build |
predicates |
Cloneable | Instantiable |
implements |
|
extends |
|
hierarchy |
Class capable of creating a Logger that outputs to console
The Logger created is equipped with a ConsoleHandler that is optimized for logging to console during test runs.
see also
see also
Constants
ConsoleLoggerCreator::CHANNEL
predicates |
public |
Default channel
string(3) "clt"
ConsoleLoggerCreator::LEVEL
predicates |
public |
Default LogLevel
string(5) "debug"
ConsoleLoggerCreator::BUBBLE
predicates |
public |
By default, does not bubble
bool(false)
ConsoleLoggerCreator::WHITE_LINE
predicates |
public |
Induce a white line before each log statement
bool(true)
ConsoleLoggerCreator::STACK_MATCH
predicates |
public |
Regular expression used to filter lines in error traces
string(8) "/(.*?)/i"
ConsoleLoggerCreator::DATE_FORMAT
predicates |
public |
Date format for log statements
string(7) "H:i:s:u"
ConsoleLoggerCreator::EXCLAMATION
predicates |
public |
Exclamation on encountering an error
string(6) "chips!"
ConsoleLoggerCreator::COLOR_SCHEME
predicates |
public |
ColorScheme used by ConsoleHandler
string(35) "bhenk\logger\handle\ColorSchemeDark"
ConsoleLoggerCreator::LOG_DIR
predicates |
public |
Inherited from |
Name of an ancestor child directory expected to be dedicated for logfiles
string(4) "logs"
Methods
ConsoleLoggerCreator::create
predicates |
public |
implements |
Creates a Logger that outputs to console
The logger created has a ConsoleHandler that outputs log statements to console
Optional $paras set behaviour of ConsoleHandler and have the following format:
"clt" => [
"channel" => {string},
"level" => {string|int|Monolog\Level|\Psr\Log\LogLevel},
"bubble" => {bool},
"white_line" => {bool},
"stack_match" => {regex},
"date_format" => {date format}, // "H:i:s:u"
"exclamation" => {string},
"color_scheme" => {string}, // bhenk\logger\handle\ColorSchemeInterface
]
$paras can be incorporated in LoggerFactory::LOG_CONFIG_FILE.
@inheritdoc
Creates a logger that implements LoggerInterface
@inheritdoc from method LoggerCreatorInterface::create
public function create(
Parameter #0 [ <optional> array $paras = [] ]
): Logger
ConsoleLoggerCreator::makeAbsolute
predicates |
public |
inherited from |
Tries to make the given filename absolute
An absolute $filename will be returned as such.
This method will than try to locate an ancestor directory with a child with the name specified by LoggerCreatorInterface::LOG_DIR (logs). The returned absolute filename will than point to a child of this ancestor-child directory.
A $filename is invalid if it is the empty string (“”) or the slash forward (/).
public function makeAbsolute(
Parameter #0 [ <required> string $filename ]
): string
Sat, 29 Apr 2023 12:38:18 +0000