Methods |
public
|
__construct(
resource $stream,
bool $close = false,
bool|null $addTimestamp = null,
string $timestampFormat = StreamTarget::DEFAULT_TIMESTAMP_FORMAT,
DateTimeZone|string|null $timezone = null,
)
Parameters
$close |
If true , the stream is closed when the target is
closed.
|
$addTimestamp |
If null (the default), timestamps are
added if $stream is not STDOUT or STDERR .
|
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|
public
static
|
fromFile(
string $filename,
bool|null $addTimestamp = null,
string $timestampFormat = StreamTarget::DEFAULT_TIMESTAMP_FORMAT,
DateTimeZone|string|null $timezone = null,
): self
Opens a file in append mode and creates a new StreamTarget object for it
Opens a file in append mode and creates a new StreamTarget object for it
Parameters
$filename |
Created with file mode 0600 if it doesn't
exist.
|
$addTimestamp |
If null (the default), timestamps are
added if $filename does not resolve to STDOUT or STDERR .
|
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|
public
|
close(): void
Close the target and any underlying resources
Close the target and any underlying resources
Overrides
Implements
|
#
|
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
|
getUri(): ?string
Get the URI or filename of the target's underlying stream, or null if its
location is unknown
Get the URI or filename of the target's underlying stream, or null if its
location is unknown
Implements
|
#
|
public
|
reopen(?string $filename = null): void
Close and reopen the target's underlying stream if possible
Close and reopen the target's underlying stream if possible
Implements
|
#
|
protected
|
doWrite(int $level, string $message, array $context): void
|
#
|
protected
|
applyStream(resource $stream): void
|
#
|
protected
|
assertIsValid(): void
Throw an exception if the target is closed
Throw an exception if the target is closed
Overrides
|
#
|