Methods |
public
|
isStdout(): bool
Check if the target writes to STDOUT
Check if the target writes to STDOUT
Overrides
|
#
|
public
|
isStderr(): bool
Check if the target writes to STDERR
Check if the target writes to STDERR
Overrides
|
#
|
public
|
isTty(): bool
Check if the target writes to a TTY
Check if the target writes to a TTY
Overrides
|
#
|
public
|
close(): void
Close the target and any underlying resources
Close the target and any underlying resources
Overrides
Implements
|
#
|
public
|
reopen(?string $path = null): void
Close and reopen the underlying PHP stream if possible
Close and reopen the underlying PHP stream if possible
Implements
|
#
|
public
static
|
fromStream(
resource $stream,
bool $closeable = false,
bool|null $addTimestamp = null,
?string $timestampFormat = StreamTarget::DEFAULT_TIMESTAMP_FORMAT,
DateTimeZone|string|null $timezone = null,
): self
Creates a new StreamTarget object backed by an open PHP stream
Creates a new StreamTarget object backed by an open PHP stream
Parameters
$closeable |
If true , call {@see File::close()} to close
$stream when the target is closed.
|
$addTimestamp |
If null , add timestamps if $stream is
not STDOUT or STDERR .
|
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|
public
static
|
fromPath(
string $path,
bool|null $addTimestamp = null,
?string $timestampFormat = StreamTarget::DEFAULT_TIMESTAMP_FORMAT,
DateTimeZone|string|null $timezone = null,
): self
Open a file in append mode and return a console output target for it
Open a file in append mode and return a console output target for it
Parameters
$addTimestamp |
If null , add timestamps if $path does
not resolve to STDOUT or STDERR .
|
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|
protected
|
writeToTarget($level, string $message, array $context): void
|
#
|
public
|
getPath(): ?string
|
#
|
protected
|
assertIsValid(): void
|
#
|