Constants

SIMPLE_DATE

SIMPLE_DATE = "Y-m-d\\TH:i:sP"

Properties

$dateFormat

$dateFormat : string

Type

string

$maxNormalizeDepth

$maxNormalizeDepth : int

Type

int

$maxNormalizeItemCount

$maxNormalizeItemCount : int

Type

int

$logLevels

$logLevels : array<int,string>

Translates Monolog log levels to html color priorities.

Type

array

$jsonEncodeOptions

$jsonEncodeOptions : int

Type

int

Methods

__construct()

__construct(string|null  $dateFormat = null) : mixed

Parameters

string|null $dateFormat

The format of the timestamp: one supported by DateTime::format

Returns

mixed —

format()

format(array  $record) : string

Formats a log record.

Parameters

array $record

Returns

string —

The formatted record

formatBatch()

formatBatch(array  $records) : string

Formats a set of log records.

Parameters

array $records

A set of records to format

Returns

string —

The formatted set of records

getDateFormat()

getDateFormat() : string

Returns

string —

setDateFormat()

setDateFormat(string  $dateFormat) : self

Parameters

string $dateFormat

Returns

self —

getMaxNormalizeDepth()

getMaxNormalizeDepth() : int

The maximum number of normalization levels to go through

Returns

int —

setMaxNormalizeDepth()

setMaxNormalizeDepth(int  $maxNormalizeDepth) : self

Parameters

int $maxNormalizeDepth

Returns

self —

getMaxNormalizeItemCount()

getMaxNormalizeItemCount() : int

The maximum number of items to normalize per level

Returns

int —

setMaxNormalizeItemCount()

setMaxNormalizeItemCount(int  $maxNormalizeItemCount) : self

Parameters

int $maxNormalizeItemCount

Returns

self —

setJsonPrettyPrint()

setJsonPrettyPrint(bool  $enable) : self

Enables `json_encode` pretty print.

Parameters

bool $enable

Returns

self —

addJsonEncodeOption()

addJsonEncodeOption(int  $option) : self

Parameters

int $option

Returns

self —

removeJsonEncodeOption()

removeJsonEncodeOption(int  $option) : self

Parameters

int $option

Returns

self —

normalize()

normalize(mixed  $data, int  $depth) : null|scalar|(array|scalar|null)[]

Parameters

mixed $data
int $depth

Returns

null|scalar|(array|scalar|null)[] —

normalizeException()

normalizeException(\Throwable  $e, int  $depth) : array

Parameters

\Throwable $e
int $depth

Returns

array —

toJson()

toJson(mixed  $data, bool  $ignoreErrors = false) : string

Return the JSON representation of a value

Parameters

mixed $data
bool $ignoreErrors

Throws

\RuntimeException

if encoding fails and errors are not ignored

Returns

string —

if encoding fails and ignoreErrors is true 'null' is returned

formatDate()

formatDate(\DateTimeInterface  $date) : string

Parameters

\DateTimeInterface $date

Returns

string —

addRow()

addRow(string  $th, string  $td = ' ', bool  $escapeTd = true) : string

Creates an HTML table row

Parameters

string $th

Row header content

string $td

Row standard cell content

bool $escapeTd

false if td content must not be html escaped

Returns

string —

addTitle()

addTitle(string  $title, int  $level) : string

Create a HTML h1 tag

Parameters

string $title

Text to be in the h1

int $level

Error level

Returns

string —

convertToString()

convertToString(mixed  $data) : string

Parameters

mixed $data

Returns

string —