LoggerDumper
in package
Table of Contents
Properties
- $HTML_COLORS : mixed
- $TERM_COLORS : mixed
Methods
- dump() : void
- Dump logs with color coding based on log level Works in both terminal and browser environments
- dumpHtml() : void
- Dump color-coded logs as HTML
- dumpTerminal() : void
- Dump color-coded logs to terminal
Properties
$HTML_COLORS
public
static mixed
$HTML_COLORS
= [
'emergency' => '#dc3545',
// Bootstrap danger red
'alert' => '#dc3545',
'critical' => '#dc3545',
'error' => '#dc3545',
'warning' => '#ffc107',
// Bootstrap warning yellow
'notice' => '#17a2b8',
// Bootstrap info blue
'info' => '#28a745',
// Bootstrap success green
'debug' => '#6c757d',
]
$TERM_COLORS
public
static mixed
$TERM_COLORS
= [
'emergency' => "\x1b[41;37m",
// White on red background
'alert' => "\x1b[41;37m",
// White on red background
'critical' => "\x1b[41;37m",
// White on red background
'error' => "\x1b[31m",
// Red
'warning' => "\x1b[33m",
// Yellow
'notice' => "\x1b[36m",
// Cyan
'info' => "\x1b[32m",
// Green
'debug' => "\x1b[90m",
// Gray
'reset' => "\x1b[0m",
]
Methods
dump()
Dump logs with color coding based on log level Works in both terminal and browser environments
public
static dump(array<string|int, mixed> $logs) : void
Parameters
- $logs : array<string|int, mixed>
-
Array of log messages from DefaultLogger::getLogs()
dumpHtml()
Dump color-coded logs as HTML
private
static dumpHtml(array<string|int, mixed> $logs) : void
Parameters
- $logs : array<string|int, mixed>
dumpTerminal()
Dump color-coded logs to terminal
private
static dumpTerminal(array<string|int, mixed> $logs) : void
Parameters
- $logs : array<string|int, mixed>