class TestLogger extends AbstractLogger (View source)

Used for testing purposes.

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

Properties

array $records
$recordsByLevel

Methods

void
emergency(string $message, array $context = array())

System is unusable.

void
alert(string $message, array $context = array())

Action must be taken immediately.

void
critical(string $message, array $context = array())

Critical conditions.

void
error(string $message, array $context = array())

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

void
warning(string $message, array $context = array())

Exceptional occurrences that are not errors.

void
notice(string $message, array $context = array())

Normal but significant events.

void
info(string $message, array $context = array())

Interesting events.

void
debug(string $message, array $context = array())

Detailed debug information.

void
log(mixed $level, string $message, array $context = [])

No description

hasRecords($level)

No description

hasRecord($record, $level)

No description

hasRecordThatContains($message, $level)

No description

hasRecordThatMatches($regex, $level)

No description

hasRecordThatPasses(callable $predicate, $level)

No description

__call($method, $args)

No description

reset()

No description

bool
hasEmergency($record)

No description

bool
hasAlert($record)

No description

bool
hasCritical($record)

No description

bool
hasError($record)

No description

bool
hasWarning($record)

No description

bool
hasNotice($record)

No description

bool
hasInfo($record)

No description

bool
hasDebug($record)

No description

bool
hasEmergencyRecords()

No description

bool
hasAlertRecords()

No description

bool
hasCriticalRecords()

No description

bool
hasErrorRecords()

No description

bool
hasWarningRecords()

No description

bool
hasNoticeRecords()

No description

bool
hasInfoRecords()

No description

bool
hasDebugRecords()

No description

bool
hasEmergencyThatContains($message)

No description

bool
hasAlertThatContains($message)

No description

bool
hasCriticalThatContains($message)

No description

bool
hasErrorThatContains($message)

No description

bool
hasWarningThatContains($message)

No description

bool
hasNoticeThatContains($message)

No description

bool
hasInfoThatContains($message)

No description

bool
hasDebugThatContains($message)

No description

bool
hasEmergencyThatMatches($message)

No description

bool
hasAlertThatMatches($message)

No description

bool
hasCriticalThatMatches($message)

No description

bool
hasErrorThatMatches($message)

No description

bool
hasWarningThatMatches($message)

No description

bool
hasNoticeThatMatches($message)

No description

bool
hasInfoThatMatches($message)

No description

bool
hasDebugThatMatches($message)

No description

bool
hasEmergencyThatPasses($message)

No description

bool
hasAlertThatPasses($message)

No description

bool
hasCriticalThatPasses($message)

No description

bool
hasErrorThatPasses($message)

No description

bool
hasWarningThatPasses($message)

No description

bool
hasNoticeThatPasses($message)

No description

bool
hasInfoThatPasses($message)

No description

bool
hasDebugThatPasses($message)

No description

Details

void emergency(string $message, array $context = array())

System is unusable.

Parameters

string $message
array $context

Return Value

void

void alert(string $message, array $context = array())

Action must be taken immediately.

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

Parameters

string $message
array $context

Return Value

void

void critical(string $message, array $context = array())

Critical conditions.

Example: Application component unavailable, unexpected exception.

Parameters

string $message
array $context

Return Value

void

void error(string $message, array $context = array())

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

Parameters

string $message
array $context

Return Value

void

void warning(string $message, array $context = array())

Exceptional occurrences that are not errors.

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

Parameters

string $message
array $context

Return Value

void

void notice(string $message, array $context = array())

Normal but significant events.

Parameters

string $message
array $context

Return Value

void

void info(string $message, array $context = array())

Interesting events.

Example: User logs in, SQL logs.

Parameters

string $message
array $context

Return Value

void

void debug(string $message, array $context = array())

Detailed debug information.

Parameters

string $message
array $context

Return Value

void

void log(mixed $level, string $message, array $context = [])

Parameters

mixed $level
string $message
array $context

Return Value

void

hasRecords($level)

Parameters

$level

hasRecord($record, $level)

Parameters

$record
$level

hasRecordThatContains($message, $level)

Parameters

$message
$level

hasRecordThatMatches($regex, $level)

Parameters

$regex
$level

hasRecordThatPasses(callable $predicate, $level)

Parameters

callable $predicate
$level

__call($method, $args)

Parameters

$method
$args

reset()

bool hasEmergency($record)

Parameters

$record

Return Value

bool

bool hasAlert($record)

Parameters

$record

Return Value

bool

bool hasCritical($record)

Parameters

$record

Return Value

bool

bool hasError($record)

Parameters

$record

Return Value

bool

bool hasWarning($record)

Parameters

$record

Return Value

bool

bool hasNotice($record)

Parameters

$record

Return Value

bool

bool hasInfo($record)

Parameters

$record

Return Value

bool

bool hasDebug($record)

Parameters

$record

Return Value

bool

bool hasEmergencyRecords()

Return Value

bool

bool hasAlertRecords()

Return Value

bool

bool hasCriticalRecords()

Return Value

bool

bool hasErrorRecords()

Return Value

bool

bool hasWarningRecords()

Return Value

bool

bool hasNoticeRecords()

Return Value

bool

bool hasInfoRecords()

Return Value

bool

bool hasDebugRecords()

Return Value

bool

bool hasEmergencyThatContains($message)

Parameters

$message

Return Value

bool

bool hasAlertThatContains($message)

Parameters

$message

Return Value

bool

bool hasCriticalThatContains($message)

Parameters

$message

Return Value

bool

bool hasErrorThatContains($message)

Parameters

$message

Return Value

bool

bool hasWarningThatContains($message)

Parameters

$message

Return Value

bool

bool hasNoticeThatContains($message)

Parameters

$message

Return Value

bool

bool hasInfoThatContains($message)

Parameters

$message

Return Value

bool

bool hasDebugThatContains($message)

Parameters

$message

Return Value

bool

bool hasEmergencyThatMatches($message)

Parameters

$message

Return Value

bool

bool hasAlertThatMatches($message)

Parameters

$message

Return Value

bool

bool hasCriticalThatMatches($message)

Parameters

$message

Return Value

bool

bool hasErrorThatMatches($message)

Parameters

$message

Return Value

bool

bool hasWarningThatMatches($message)

Parameters

$message

Return Value

bool

bool hasNoticeThatMatches($message)

Parameters

$message

Return Value

bool

bool hasInfoThatMatches($message)

Parameters

$message

Return Value

bool

bool hasDebugThatMatches($message)

Parameters

$message

Return Value

bool

bool hasEmergencyThatPasses($message)

Parameters

$message

Return Value

bool

bool hasAlertThatPasses($message)

Parameters

$message

Return Value

bool

bool hasCriticalThatPasses($message)

Parameters

$message

Return Value

bool

bool hasErrorThatPasses($message)

Parameters

$message

Return Value

bool

bool hasWarningThatPasses($message)

Parameters

$message

Return Value

bool

bool hasNoticeThatPasses($message)

Parameters

$message

Return Value

bool

bool hasInfoThatPasses($message)

Parameters

$message

Return Value

bool

bool hasDebugThatPasses($message)

Parameters

$message

Return Value

bool