Documentation

TestLogger extends AbstractLogger
in package

Used for testing purposes.

It records all records and gives you access to them for verification.

Table of Contents

Properties

$records  : array<string|int, mixed>
$recordsByLevel  : mixed

Methods

__call()  : mixed
alert()  : void
Action must be taken immediately.
critical()  : void
Critical conditions.
debug()  : void
Detailed debug information.
emergency()  : void
System is unusable.
error()  : void
Runtime errors that do not require immediate action but should typically be logged and monitored.
hasAlert()  : bool
hasAlertRecords()  : bool
hasAlertThatContains()  : bool
hasAlertThatMatches()  : bool
hasAlertThatPasses()  : bool
hasCritical()  : bool
hasCriticalRecords()  : bool
hasCriticalThatContains()  : bool
hasCriticalThatMatches()  : bool
hasCriticalThatPasses()  : bool
hasDebug()  : bool
hasDebugRecords()  : bool
hasDebugThatContains()  : bool
hasDebugThatMatches()  : bool
hasDebugThatPasses()  : bool
hasEmergency()  : bool
hasEmergencyRecords()  : bool
hasEmergencyThatContains()  : bool
hasEmergencyThatMatches()  : bool
hasEmergencyThatPasses()  : bool
hasError()  : bool
hasErrorRecords()  : bool
hasErrorThatContains()  : bool
hasErrorThatMatches()  : bool
hasErrorThatPasses()  : bool
hasInfo()  : bool
hasInfoRecords()  : bool
hasInfoThatContains()  : bool
hasInfoThatMatches()  : bool
hasInfoThatPasses()  : bool
hasNotice()  : bool
hasNoticeRecords()  : bool
hasNoticeThatContains()  : bool
hasNoticeThatMatches()  : bool
hasNoticeThatPasses()  : bool
hasRecord()  : mixed
hasRecords()  : mixed
hasRecordThatContains()  : mixed
hasRecordThatMatches()  : mixed
hasRecordThatPasses()  : mixed
hasWarning()  : bool
hasWarningRecords()  : bool
hasWarningThatContains()  : bool
hasWarningThatMatches()  : bool
hasWarningThatPasses()  : bool
info()  : void
Interesting events.
log()  : void
Logs with an arbitrary level.
notice()  : void
Normal but significant events.
reset()  : mixed
warning()  : void
Exceptional occurrences that are not errors.

Properties

$records

public array<string|int, mixed> $records = []

$recordsByLevel

public mixed $recordsByLevel = []

Methods

__call()

public __call(mixed $method, mixed $args) : mixed
Parameters
$method : mixed
$args : mixed

alert()

Action must be taken immediately.

public alert(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

Parameters
$message : string
$context : array<string|int, mixed> = array()

critical()

Critical conditions.

public critical(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: Application component unavailable, unexpected exception.

Parameters
$message : string
$context : array<string|int, mixed> = array()

debug()

Detailed debug information.

public debug(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

emergency()

System is unusable.

public emergency(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

error()

Runtime errors that do not require immediate action but should typically be logged and monitored.

public error(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

hasAlert()

public hasAlert(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasAlertRecords()

public hasAlertRecords() : bool
Return values
bool

hasAlertThatContains()

public hasAlertThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasAlertThatMatches()

public hasAlertThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasAlertThatPasses()

public hasAlertThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasCritical()

public hasCritical(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasCriticalRecords()

public hasCriticalRecords() : bool
Return values
bool

hasCriticalThatContains()

public hasCriticalThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasCriticalThatMatches()

public hasCriticalThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasCriticalThatPasses()

public hasCriticalThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasDebug()

public hasDebug(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasDebugRecords()

public hasDebugRecords() : bool
Return values
bool

hasDebugThatContains()

public hasDebugThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasDebugThatMatches()

public hasDebugThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasDebugThatPasses()

public hasDebugThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasEmergency()

public hasEmergency(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasEmergencyRecords()

public hasEmergencyRecords() : bool
Return values
bool

hasEmergencyThatContains()

public hasEmergencyThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasEmergencyThatMatches()

public hasEmergencyThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasEmergencyThatPasses()

public hasEmergencyThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasError()

public hasError(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasErrorRecords()

public hasErrorRecords() : bool
Return values
bool

hasErrorThatContains()

public hasErrorThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasErrorThatMatches()

public hasErrorThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasErrorThatPasses()

public hasErrorThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasInfo()

public hasInfo(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasInfoRecords()

public hasInfoRecords() : bool
Return values
bool

hasInfoThatContains()

public hasInfoThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasInfoThatMatches()

public hasInfoThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasInfoThatPasses()

public hasInfoThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasNotice()

public hasNotice(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasNoticeRecords()

public hasNoticeRecords() : bool
Return values
bool

hasNoticeThatContains()

public hasNoticeThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasNoticeThatMatches()

public hasNoticeThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasNoticeThatPasses()

public hasNoticeThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasRecord()

public hasRecord(mixed $record, mixed $level) : mixed
Parameters
$record : mixed
$level : mixed

hasRecords()

public hasRecords(mixed $level) : mixed
Parameters
$level : mixed

hasRecordThatContains()

public hasRecordThatContains(mixed $message, mixed $level) : mixed
Parameters
$message : mixed
$level : mixed

hasRecordThatMatches()

public hasRecordThatMatches(mixed $regex, mixed $level) : mixed
Parameters
$regex : mixed
$level : mixed

hasRecordThatPasses()

public hasRecordThatPasses(callable $predicate, mixed $level) : mixed
Parameters
$predicate : callable
$level : mixed

hasWarning()

public hasWarning(mixed $record) : bool
Parameters
$record : mixed
Return values
bool

hasWarningRecords()

public hasWarningRecords() : bool
Return values
bool

hasWarningThatContains()

public hasWarningThatContains(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasWarningThatMatches()

public hasWarningThatMatches(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

hasWarningThatPasses()

public hasWarningThatPasses(mixed $message) : bool
Parameters
$message : mixed
Return values
bool

info()

Interesting events.

public info(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: User logs in, SQL logs.

Parameters
$message : string
$context : array<string|int, mixed> = array()

log()

Logs with an arbitrary level.

public log(mixed $level, mixed $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : mixed
$message : mixed
$context : array<string|int, mixed> = []
Tags
inheritdoc

notice()

Normal but significant events.

public notice(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

warning()

Exceptional occurrences that are not errors.

public warning(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

Parameters
$message : string
$context : array<string|int, mixed> = array()

        
On this page

Search results