LogViewer
in package
Class LogViewer
Table of Contents
Properties
- $pattern : string
Methods
- levelColor() : string
- Helper class to get level color
- objectTail() : array<string|int, mixed>
- Get the objects of a tailed file
- parse() : array<string|int, mixed>
- Parse a monolog row into array bits
- parseTrace() : array<string|int, mixed>
- Parse text of trace into an array of lines
- tail() : string|false
- Optimized way to get just the last few entries of a log file
Properties
$pattern
protected
string
$pattern
= '/\[(?P<date>.*?)\] (?P<logger>\w+)\.(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/'
Methods
levelColor()
Helper class to get level color
public
static levelColor(string $level) : string
Parameters
- $level : string
Return values
stringobjectTail()
Get the objects of a tailed file
public
objectTail(string $filepath[, int $lines = 1 ][, bool $desc = true ]) : array<string|int, mixed>
Parameters
- $filepath : string
- $lines : int = 1
- $desc : bool = true
Return values
array<string|int, mixed>parse()
Parse a monolog row into array bits
public
parse(string $line) : array<string|int, mixed>
Parameters
- $line : string
Return values
array<string|int, mixed>parseTrace()
Parse text of trace into an array of lines
public
static parseTrace(string $trace[, int $rows = 10 ]) : array<string|int, mixed>
Parameters
- $trace : string
- $rows : int = 10
Return values
array<string|int, mixed>tail()
Optimized way to get just the last few entries of a log file
public
tail(string $filepath[, int $lines = 1 ]) : string|false
Parameters
- $filepath : string
- $lines : int = 1