FormatsOutput
trait FormatsOutput
Methods
Verify the given entry types are valid, printing an error if not.
Append a unit to the given value, or return an empty string if it has none.
Get a shortened UUID for display.
Format a timestamp as a human readable difference.
Colorize an HTTP method for console output.
Colorize an HTTP status code for console output.
Colorize a log level for console output.
Colorize a cache action for console output.
Colorize a job status for console output.
Format a value as a pretty-printed JSON block.
Write the given data as JSON output.
Details
at line 18
protected bool
ensureValidEntryTypes(string ...$types)
Verify the given entry types are valid, printing an error if not.
at line 35
protected string
unit(int|float|string|null $value, string $unit)
Append a unit to the given value, or return an empty string if it has none.
at line 43
protected string
shortUuid(string $uuid)
Get a shortened UUID for display.
at line 51
protected string
humanTime(CarbonInterface $date)
Format a timestamp as a human readable difference.
at line 59
protected string
summarizeEntry(EntryResult $entry)
Generate a one-line summary for the given entry.
at line 88
protected string
colorMethod(string $method)
Colorize an HTTP method for console output.
at line 101
protected string
colorStatus(int $status)
Colorize an HTTP status code for console output.
at line 114
protected string
colorLevel(string $level)
Colorize a log level for console output.
at line 128
protected string
colorCacheAction(string $type)
Colorize a cache action for console output.
at line 142
protected string
colorJobStatus(string $status)
Colorize a job status for console output.
at line 155
protected string
jsonBlock(mixed $data)
Format a value as a pretty-printed JSON block.
at line 163
protected void
writeJson(mixed $data)
Write the given data as JSON output.