Methods |
public
static
|
clearProgress(): ConsoleWriterInterface
Print a "clear to end of line" control sequence with level INFO to TTY targets with a logProgress() message
Print a "clear to end of line" control sequence with level INFO to TTY targets with a logProgress() message
|
#
|
public
static
|
count(MessageLevel::* $level): ConsoleWriterInterface
Record a message with level $level without printing anything
Record a message with level $level without printing anything
|
#
|
public
static
|
debug(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, int $depth = 0): ConsoleWriterInterface
Print ": <caller> $msg1 $msg2" with level DEBUG (see {@see ConsoleWriterInterface::debug()})
Print ": $msg1 $msg2" with level DEBUG (see {@see ConsoleWriterInterface::debug()})
|
#
|
public
static
|
debugOnce(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, int $depth = 0): ConsoleWriterInterface
Print ": <caller> $msg1 $msg2" with level DEBUG once per run (see {@see ConsoleWriterInterface::debugOnce()})
Print ": $msg1 $msg2" with level DEBUG once per run (see {@see ConsoleWriterInterface::debugOnce()})
|
#
|
public
static
|
deregisterTarget(ConsoleTargetInterface $target): ConsoleWriterInterface
Deregister and close a registered target (see {@see ConsoleWriterInterface::deregisterTarget()})
Deregister and close a registered target (see {@see ConsoleWriterInterface::deregisterTarget()})
|
#
|
public
static
|
error(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, bool $count = true): ConsoleWriterInterface
Print "! $msg1 $msg2" with level ERROR
Print "! $msg1 $msg2" with level ERROR
|
#
|
public
static
|
errorOnce(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, bool $count = true): ConsoleWriterInterface
Print "! $msg1 $msg2" with level ERROR once per run
Print "! $msg1 $msg2" with level ERROR once per run
|
#
|
public
static
|
escape(string $string): string
Escape a string so it can be safely used in a console message
Escape a string so it can be safely used in a console message
|
#
|
public
static
|
exception(
Throwable $exception,
MessageLevel::* $level = MessageLevel::ERROR,
MessageLevel::*|null $traceLevel = MessageLevel::DEBUG,
): ConsoleWriterInterface
Print an exception's name and message with a given level, optionally followed by its stack trace with a different level…
Print an exception's name and message with a given level, optionally followed by its stack trace with a different level (see {@see ConsoleWriterInterface::exception()})
|
#
|
public
static
|
getErrorCount(): int
Get the number of error messages recorded by the writer so far
Get the number of error messages recorded by the writer so far
|
#
|
public
static
|
getFormatter(MessageLevel::* $level = MessageLevel::INFO): ConsoleFormatterInterface
Get an output formatter for a registered target (see {@see ConsoleWriterInterface::getFormatter()})
Get an output formatter for a registered target (see {@see ConsoleWriterInterface::getFormatter()})
|
#
|
public
static
|
getLogger(): LoggerInterface
Get a PSR-3 logger backed by the writer
Get a PSR-3 logger backed by the writer
|
#
|
public
static
|
getStderrTarget(): ConsoleTargetStreamInterface
Get a target for STDERR, creating an unregistered one if necessary
Get a target for STDERR, creating an unregistered one if necessary
|
#
|
public
static
|
getStdoutTarget(): ConsoleTargetStreamInterface
Get a target for STDOUT, creating an unregistered one if necessary
Get a target for STDOUT, creating an unregistered one if necessary
|
#
|
public
static
|
getTargets(
MessageLevel::*|null $level = null,
int-mask-of<ConsoleTargetTypeFlag::*> $flags = 0,
): ConsoleTargetInterface[]
Get a list of registered targets, optionally filtered by level and type
Get a list of registered targets, optionally filtered by level and type
|
#
|
public
static
|
getWarningCount(): int
Get the number of warning messages recorded by the writer so far
Get the number of warning messages recorded by the writer so far
|
#
|
public
static
|
getWidth(MessageLevel::* $level = MessageLevel::INFO): int|null
Get the width of a registered target in columns (see {@see ConsoleWriterInterface::getWidth()})
Get the width of a registered target in columns (see {@see ConsoleWriterInterface::getWidth()})
|
#
|
public
static
|
group(
string $msg1,
string|null $msg2 = null,
string|null $endMsg1 = null,
string|null $endMsg2 = null,
): ConsoleWriterInterface
Increase the indentation level of messages and print "» $msg1 $msg2" with level NOTICE (see {@see…
Increase the indentation level of messages and print "» $msg1 $msg2" with level NOTICE (see {@see ConsoleWriterInterface::group()})
|
#
|
public
static
|
groupEnd(): ConsoleWriterInterface
Close the nested message group most recently opened with group()
Close the nested message group most recently opened with group()
|
#
|
public
static
|
info(string $msg1, string|null $msg2 = null): ConsoleWriterInterface
Print "➤ $msg1 $msg2" with level NOTICE
Print "➤ $msg1 $msg2" with level NOTICE
|
#
|
public
static
|
infoOnce(string $msg1, string|null $msg2 = null): ConsoleWriterInterface
Print "➤ $msg1 $msg2" with level NOTICE once per run
Print "➤ $msg1 $msg2" with level NOTICE once per run
|
#
|
public
static
|
log(string $msg1, string|null $msg2 = null): ConsoleWriterInterface
Print "- $msg1 $msg2" with level INFO
Print "- $msg1 $msg2" with level INFO
|
#
|
public
static
|
logOnce(string $msg1, string|null $msg2 = null): ConsoleWriterInterface
Print "- $msg1 $msg2" with level INFO once per run
Print "- $msg1 $msg2" with level INFO once per run
|
#
|
public
static
|
logProgress(string $msg1, string|null $msg2 = null): ConsoleWriterInterface
Print "⠿ $msg1 $msg2" with level INFO to TTY targets without moving to the next line (see {@see ConsoleWriterInterface:…
Print "⠿ $msg1 $msg2" with level INFO to TTY targets without moving to the next line (see {@see ConsoleWriterInterface::logProgress()})
|
#
|
public
static
|
message(
string $msg1,
string|null $msg2 = null,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNDECORATED,
Throwable|null $ex = null,
bool $count = true,
): ConsoleWriterInterface
Print "$msg1 $msg2" with prefix and formatting optionally based on $level
Print "$msg1 $msg2" with prefix and formatting optionally based on $level
|
#
|
public
static
|
messageOnce(
string $msg1,
string|null $msg2 = null,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNDECORATED,
Throwable|null $ex = null,
bool $count = true,
): ConsoleWriterInterface
Print "$msg1 $msg2" with prefix and formatting optionally based on $level once per run
Print "$msg1 $msg2" with prefix and formatting optionally based on $level once per run
|
#
|
public
static
|
print(
string $msg,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNFORMATTED,
): ConsoleWriterInterface
Print "$msg" to registered targets
Print "$msg" to registered targets
|
#
|
public
static
|
printOut(
string $msg,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNFORMATTED,
): ConsoleWriterInterface
Print "$msg" to registered STDOUT or STDERR targets
Print "$msg" to registered STDOUT or STDERR targets
|
#
|
public
static
|
printStderr(
string $msg,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNFORMATTED,
): ConsoleWriterInterface
Print "$msg" to STDERR even if no STDERR target is registered
Print "$msg" to STDERR even if no STDERR target is registered
|
#
|
public
static
|
printStdout(
string $msg,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNFORMATTED,
): ConsoleWriterInterface
Print "$msg" to STDOUT even if no STDOUT target is registered
Print "$msg" to STDOUT even if no STDOUT target is registered
|
#
|
public
static
|
printTty(
string $msg,
MessageLevel::* $level = MessageLevel::INFO,
ConsoleMessageType::* $type = ConsoleMessageType::UNFORMATTED,
): ConsoleWriterInterface
Print "$msg" to registered TTY targets
Print "$msg" to registered TTY targets
|
#
|
public
static
|
registerStderrTarget(): ConsoleWriterInterface
Register STDERR to receive console output if running on the command line (see {@see ConsoleWriterInterface:…
Register STDERR to receive console output if running on the command line (see {@see ConsoleWriterInterface::registerStderrTarget()})
|
#
|
public
static
|
registerStdioTargets(): ConsoleWriterInterface
Register STDOUT and STDERR to receive console output if running on the command line (see {@see ConsoleWriterInterface:…
Register STDOUT and STDERR to receive console output if running on the command line (see {@see ConsoleWriterInterface::registerStdioTargets()})
|
#
|
public
static
|
registerTarget(
ConsoleTargetInterface $target,
array<MessageLevel::*> $levels = MessageLevelGroup::ALL,
): ConsoleWriterInterface
Register a target to receive console output
Register a target to receive console output
|
#
|
public
static
|
setTargetPrefix(string|null $prefix, int-mask-of<ConsoleTargetTypeFlag::*> $flags = 0): ConsoleWriterInterface
Set or unset the prefix applied to each line of output by any registered targets that implement…
Set or unset the prefix applied to each line of output by any registered targets that implement ConsoleTargetPrefixInterface
|
#
|
public
static
|
summary(
string $finishedText = "'Command finished'",
string $successText = "'without errors'",
bool $withResourceUsage = false,
bool $withoutErrorCount = false,
bool $withStandardMessageType = false,
): ConsoleWriterInterface
Print a "command finished" message with a summary of errors, warnings and resource usage
Print a "command finished" message with a summary of errors, warnings and resource usage
|
#
|
public
static
|
warn(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, bool $count = true): ConsoleWriterInterface
Print "^ $msg1 $msg2" with level WARNING
Print "^ $msg1 $msg2" with level WARNING
|
#
|
public
static
|
warnOnce(string $msg1, string|null $msg2 = null, Throwable|null $ex = null, bool $count = true): ConsoleWriterInterface
Print "^ $msg1 $msg2" with level WARNING once per run
Print "^ $msg1 $msg2" with level WARNING once per run
|
#
|