AnsiConsoleBackend
class AnsiConsoleBackend extends ConsoleBackend (View source)
Extended ANSI console backend with human friendly formatting
Constants
FG_BLACK |
|
FG_WHITE |
|
FG_GRAY |
|
FG_BLUE |
|
FG_CYAN |
|
FG_YELLOW |
|
FG_RED |
|
FG_GREEN |
|
BG_CYAN |
|
BG_GREEN |
|
BG_RED |
|
BG_YELLOW |
|
BG_WHITE |
|
END |
|
Properties
protected int | $severityThreshold | One of the LOG_* constants. Anything below that will be filtered out. |
from AbstractBackend |
protected bool | $logIpAddress | Flag telling if the IP address of the current client (if available) should be logged. |
from AbstractBackend |
protected array | $severityLabels | An array of severity labels, indexed by their integer constant |
from ConsoleBackend |
protected string | $streamName | Stream name to use (stdout, stderr) |
from ConsoleBackend |
protected resource | $streamHandle | from ConsoleBackend | |
protected array | $tagFormats | ||
protected bool | $disableAnsi |
Methods
The maximum severity to log, anything less severe will not be logged.
Enables or disables logging of IP addresses.
Open the log backend
Appends the given message along with the additional information into the log.
Carries out all actions necessary to cleanly close the logging backend, such as closing the log file or disconnecting from a database.
Apply ansi formatting to output according to tags
No description
No description
Details
__construct(mixed $options = [])
Constructs this log backend
void
setSeverityThreshold(int $severityThreshold)
The maximum severity to log, anything less severe will not be logged.
void
setLogIpAddress(bool $logIpAddress)
Enables or disables logging of IP addresses.
void
open()
Open the log backend
Initializes tag formats.
void
append(string $message, int $severity = LOG_INFO, mixed $additionalData = null, string $packageKey = null, string $className = null, string $methodName = null)
Appends the given message along with the additional information into the log.
void
close()
Carries out all actions necessary to cleanly close the logging backend, such as closing the log file or disconnecting from a database.
Note: for this backend we do nothing here and rely on PHP to close the stream handle when the request ends. This is to allow full logging until request end.
protected string
formatOutput(string $output)
Apply ansi formatting to output according to tags
setDisableAnsi(bool $disableAnsi)
No description
bool
getDisableAnsi()
No description