Cecil

ConsoleLogger extends PrintLogger

Console logger class.

This logger prints messages to the console output. It supports different log levels and can be configured to print messages up to a certain verbosity level.

Table of Contents

Constants

DEBUG  = 'debug'
ERROR  = 'error'
INFO  = 'text'
NOTICE  = 'info'
WARNING  = 'comment'

Properties

$formatLevelMap  : mixed
$output  : mixed
$printLevelMax  : int
$verbosityLevelMap  : array<string|int, mixed>

Methods

__construct()  : mixed
Print only the $printLevelMax.
format()  : string
Format expression to string.
log()  : void
{@inheritdoc}
interpolate()  : string
Interpolates context values into the message placeholders.
padPrefix()  : string
Prefix padding.

Constants

Properties

$formatLevelMap

protected mixed $formatLevelMap = [\Psr\Log\LogLevel::EMERGENCY => self::ERROR, \Psr\Log\LogLevel::ALERT => self::ERROR, \Psr\Log\LogLevel::CRITICAL => self::ERROR, \Psr\Log\LogLevel::ERROR => self::ERROR, \Psr\Log\LogLevel::WARNING => self::WARNING, \Psr\Log\LogLevel::NOTICE => self::NOTICE, \Psr\Log\LogLevel::INFO => self::INFO, \Psr\Log\LogLevel::DEBUG => self::DEBUG]

$verbosityLevelMap

protected array<string|int, mixed> $verbosityLevelMap = [\Psr\Log\LogLevel::EMERGENCY => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::ALERT => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::CRITICAL => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::ERROR => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::WARNING => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE, \Psr\Log\LogLevel::NOTICE => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERBOSE, \Psr\Log\LogLevel::INFO => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE, \Psr\Log\LogLevel::DEBUG => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_DEBUG]

Methods

__construct()

Print only the $printLevelMax.

public __construct(OutputInterface $output[, array<string|int, mixed> $verbosityLevelMap = [] ][, array<string|int, mixed> $formatLevelMap = [] ]) : mixed
Parameters
$output : OutputInterface
$verbosityLevelMap : array<string|int, mixed> = []
$formatLevelMap : array<string|int, mixed> = []

format()

Format expression to string.

public static format(mixed $expression) : string
Parameters
$expression : mixed
Return values
string

log()

{@inheritdoc}

public log(mixed $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : mixed
$message : string|Stringable
$context : array<string|int, mixed> = []

interpolate()

Interpolates context values into the message placeholders.

protected interpolate(string $message, array<string|int, mixed> $context) : string
Parameters
$message : string
$context : array<string|int, mixed>
Tags
author

PHP Framework Interoperability Group

Return values
string

padPrefix()

Prefix padding.

private padPrefix(string $prefix, string $max) : string
Parameters
$prefix : string
$max : string
Return values
string
 
On this page

Search results