shipcloud PHP Client

TestHandler extends AbstractProcessingHandler
in package

Used for testing purposes.

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

Tags
author

Jordi Boggiano j.boggiano@seld.be

Table of Contents

$bubble  : mixed
$formatter  : FormatterInterface
$level  : mixed
$processors  : mixed
$records  : mixed
$recordsByLevel  : mixed
$skipReset  : mixed
__call()  : mixed
__construct()  : mixed
__destruct()  : mixed
clear()  : mixed
close()  : mixed
Closes the handler.
getBubble()  : bool
Gets the bubbling behavior.
getFormatter()  : FormatterInterface
Gets the formatter.
getLevel()  : int
Gets minimum logging level at which this handler will be triggered.
getRecords()  : mixed
handle()  : mixed
{@inheritdoc}
handleBatch()  : mixed
Handles a set of records at once.
hasAlert()  :
hasAlertRecords()  :
hasAlertThatContains()  :
hasAlertThatMatches()  :
hasAlertThatPasses()  :
hasCritical()  :
hasCriticalRecords()  :
hasCriticalThatContains()  :
hasCriticalThatMatches()  :
hasCriticalThatPasses()  :
hasDebug()  :
hasDebugRecords()  :
hasDebugThatContains()  :
hasDebugThatMatches()  :
hasDebugThatPasses()  :
hasEmergency()  :
hasEmergencyRecords()  :
hasEmergencyThatContains()  :
hasEmergencyThatMatches()  :
hasEmergencyThatPasses()  :
hasError()  :
hasErrorRecords()  :
hasErrorThatContains()  :
hasErrorThatMatches()  :
hasErrorThatPasses()  :
hasInfo()  :
hasInfoRecords()  :
hasInfoThatContains()  :
hasInfoThatMatches()  :
hasInfoThatPasses()  :
hasNotice()  :
hasNoticeRecords()  :
hasNoticeThatContains()  :
hasNoticeThatMatches()  :
hasNoticeThatPasses()  :
hasRecord()  : mixed
hasRecords()  : mixed
hasRecordThatContains()  : mixed
hasRecordThatMatches()  : mixed
hasRecordThatPasses()  : mixed
hasWarning()  :
hasWarningRecords()  :
hasWarningThatContains()  :
hasWarningThatMatches()  :
hasWarningThatPasses()  :
isHandling()  : bool
Checks whether the given record will be handled by this handler.
popProcessor()  : callable
Removes the processor on top of the stack and returns it.
pushProcessor()  : self
Adds a processor in the stack.
reset()  : mixed
setBubble()  : self
Sets the bubbling behavior.
setFormatter()  : self
Sets the formatter.
setLevel()  : self
Sets minimum logging level at which this handler will be triggered.
setSkipReset()  : mixed
getDefaultFormatter()  : FormatterInterface
Gets the default formatter.
processRecord()  : array<string|int, mixed>
Processes a record.
write()  : void
Writes the record down to the log of the implementing handler

Properties

$recordsByLevel

protected mixed $recordsByLevel = array()

Methods

__call()

public __call(mixed $method, mixed $args) : mixed
Parameters
$method : mixed
$args : mixed
Return values
mixed —

__construct()

public __construct([int|string $level = Logger::DEBUG ][, bool $bubble = true ]) : mixed
Parameters
$level : int|string = Logger::DEBUG

The minimum logging level at which this handler will be triggered

$bubble : bool = true

Whether the messages that are handled can bubble up the stack or not

Return values
mixed —

clear()

public clear() : mixed
Return values
mixed —

close()

Closes the handler.

public close() : mixed

This will be called automatically when the object is destroyed

Return values
mixed —

getBubble()

Gets the bubbling behavior.

public getBubble() : bool
Return values
bool —

true means that this handler allows bubbling. false means that bubbling is not permitted.

getLevel()

Gets minimum logging level at which this handler will be triggered.

public getLevel() : int
Return values
int —

getRecords()

public getRecords() : mixed
Return values
mixed —

handle()

{@inheritdoc}

public handle(array<string|int, mixed> $record) : mixed
Parameters
$record : array<string|int, mixed>
Return values
mixed —

handleBatch()

Handles a set of records at once.

public handleBatch(array<string|int, mixed> $records) : mixed
Parameters
$records : array<string|int, mixed>

The records to handle (an array of record arrays)

Return values
mixed —

hasAlert()

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

hasAlertRecords()

public hasAlertRecords() :
Return values
—

hasAlertThatContains()

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

hasAlertThatMatches()

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

hasAlertThatPasses()

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

hasCritical()

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

hasCriticalRecords()

public hasCriticalRecords() :
Return values
—

hasCriticalThatContains()

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

hasCriticalThatMatches()

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

hasCriticalThatPasses()

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

hasDebug()

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

hasDebugRecords()

public hasDebugRecords() :
Return values
—

hasDebugThatContains()

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

hasDebugThatMatches()

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

hasDebugThatPasses()

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

hasEmergency()

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

hasEmergencyRecords()

public hasEmergencyRecords() :
Return values
—

hasEmergencyThatContains()

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

hasEmergencyThatMatches()

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

hasEmergencyThatPasses()

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

hasError()

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

hasErrorRecords()

public hasErrorRecords() :
Return values
—

hasErrorThatContains()

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

hasErrorThatMatches()

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

hasErrorThatPasses()

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

hasInfo()

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

hasInfoRecords()

public hasInfoRecords() :
Return values
—

hasInfoThatContains()

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

hasInfoThatMatches()

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

hasInfoThatPasses()

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

hasNotice()

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

hasNoticeRecords()

public hasNoticeRecords() :
Return values
—

hasNoticeThatContains()

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

hasNoticeThatMatches()

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

hasNoticeThatPasses()

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

hasRecord()

public hasRecord(string|array<string|int, mixed> $record, int $level) : mixed
Parameters
$record : string|array<string|int, mixed>

Either a message string or an array containing message and optionally context keys that will be checked against all records

$level : int

Logger::LEVEL constant value

Return values
mixed —

hasRecords()

public hasRecords(mixed $level) : mixed
Parameters
$level : mixed
Return values
mixed —

hasRecordThatContains()

public hasRecordThatContains(mixed $message, mixed $level) : mixed
Parameters
$message : mixed
$level : mixed
Return values
mixed —

hasRecordThatMatches()

public hasRecordThatMatches(mixed $regex, mixed $level) : mixed
Parameters
$regex : mixed
$level : mixed
Return values
mixed —

hasRecordThatPasses()

public hasRecordThatPasses(mixed $predicate, mixed $level) : mixed
Parameters
$predicate : mixed
$level : mixed
Return values
mixed —

hasWarning()

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

hasWarningRecords()

public hasWarningRecords() :
Return values
—

hasWarningThatContains()

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

hasWarningThatMatches()

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

hasWarningThatPasses()

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

isHandling()

Checks whether the given record will be handled by this handler.

public isHandling(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>

Partial log record containing only a level key

Return values
bool —

popProcessor()

Removes the processor on top of the stack and returns it.

public popProcessor() : callable
Return values
callable —

pushProcessor()

Adds a processor in the stack.

public pushProcessor(mixed $callback) : self
Parameters
$callback : mixed
Return values
self —

reset()

public reset() : mixed
Return values
mixed —

setBubble()

Sets the bubbling behavior.

public setBubble(bool $bubble) : self
Parameters
$bubble : bool

true means that this handler allows bubbling. false means that bubbling is not permitted.

Return values
self —

setLevel()

Sets minimum logging level at which this handler will be triggered.

public setLevel(int|string $level) : self
Parameters
$level : int|string

Level or level name

Return values
self —

setSkipReset()

public setSkipReset(mixed $skipReset) : mixed
Parameters
$skipReset : mixed
Return values
mixed —

processRecord()

Processes a record.

protected processRecord(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
$record : array<string|int, mixed>
Return values
array<string|int, mixed> —

write()

Writes the record down to the log of the implementing handler

protected write(array<string|int, mixed> $record) : void
Parameters
$record : array<string|int, mixed>
Return values
void —

Search results