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
boolhasAlertRecords()
public
hasAlertRecords() : bool
Return values
boolhasAlertThatContains()
public
hasAlertThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasAlertThatMatches()
public
hasAlertThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasAlertThatPasses()
public
hasAlertThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasCritical()
public
hasCritical(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasCriticalRecords()
public
hasCriticalRecords() : bool
Return values
boolhasCriticalThatContains()
public
hasCriticalThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasCriticalThatMatches()
public
hasCriticalThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasCriticalThatPasses()
public
hasCriticalThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasDebug()
public
hasDebug(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasDebugRecords()
public
hasDebugRecords() : bool
Return values
boolhasDebugThatContains()
public
hasDebugThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasDebugThatMatches()
public
hasDebugThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasDebugThatPasses()
public
hasDebugThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasEmergency()
public
hasEmergency(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasEmergencyRecords()
public
hasEmergencyRecords() : bool
Return values
boolhasEmergencyThatContains()
public
hasEmergencyThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasEmergencyThatMatches()
public
hasEmergencyThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasEmergencyThatPasses()
public
hasEmergencyThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasError()
public
hasError(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasErrorRecords()
public
hasErrorRecords() : bool
Return values
boolhasErrorThatContains()
public
hasErrorThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasErrorThatMatches()
public
hasErrorThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasErrorThatPasses()
public
hasErrorThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasInfo()
public
hasInfo(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasInfoRecords()
public
hasInfoRecords() : bool
Return values
boolhasInfoThatContains()
public
hasInfoThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasInfoThatMatches()
public
hasInfoThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasInfoThatPasses()
public
hasInfoThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasNotice()
public
hasNotice(mixed $record) : bool
Parameters
- $record : mixed
Return values
boolhasNoticeRecords()
public
hasNoticeRecords() : bool
Return values
boolhasNoticeThatContains()
public
hasNoticeThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasNoticeThatMatches()
public
hasNoticeThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasNoticeThatPasses()
public
hasNoticeThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasRecord()
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
boolhasWarningRecords()
public
hasWarningRecords() : bool
Return values
boolhasWarningThatContains()
public
hasWarningThatContains(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasWarningThatMatches()
public
hasWarningThatMatches(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolhasWarningThatPasses()
public
hasWarningThatPasses(mixed $message) : bool
Parameters
- $message : mixed
Return values
boolinfo()
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
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()
reset()
public
reset() : mixed
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()