class Logger

Properties

protected string $streamBuffer

The buffer for streaming text.

Methods

__construct(string $identifier, null|resource $socket = null)

Create a new Logger instance.

void
line(string $message)

Log a line to the process log.

void
partial(string $chunk)

Append a chunk of text, accumulating on the current line(s).

void
commitPartial()

Commit the accumulated partial text and start fresh.

void
success(string $message)

Log a success message to the process log.

void
warning(string $message)

Log a warning message to the process log.

void
error(string $message)

Log an error message to the process log.

void
label(string $message)

Update the label of the process log.

void
subLabel(string $message)

Update the sub-label of the process log. Pass an empty string to clear.

void
write(string $message, string|null $type = null)

Write a message to the socket.

string
prefix(string $type, string $message)

Prefix a message with the identifier and type.

Details

at line 14
__construct(string $identifier, null|resource $socket = null)

Create a new Logger instance.

Parameters

string $identifier
null|resource $socket

at line 26
void line(string $message)

Log a line to the process log.

Parameters

string $message

Return Value

void

at line 34
void partial(string $chunk)

Append a chunk of text, accumulating on the current line(s).

Parameters

string $chunk

Return Value

void

at line 43
void commitPartial()

Commit the accumulated partial text and start fresh.

Return Value

void

at line 52
void success(string $message)

Log a success message to the process log.

Parameters

string $message

Return Value

void

at line 60
void warning(string $message)

Log a warning message to the process log.

Parameters

string $message

Return Value

void

at line 68
void error(string $message)

Log an error message to the process log.

Parameters

string $message

Return Value

void

at line 76
void label(string $message)

Update the label of the process log.

Parameters

string $message

Return Value

void

at line 84
void subLabel(string $message)

Update the sub-label of the process log. Pass an empty string to clear.

Parameters

string $message

Return Value

void

at line 92
protected void write(string $message, string|null $type = null)

Write a message to the socket.

Parameters

string $message
string|null $type

Return Value

void

at line 108
protected string prefix(string $type, string $message)

Prefix a message with the identifier and type.

Parameters

string $type
string $message

Return Value

string