\Monolog\HandlerFirePHPHandler

Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol.

Classes extending it should (in most cases) only implement write($record)

Summary

Methods
Properties
Constants
handle()
__construct()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
No public properties found
PROTOCOL_URI
STRUCTURE_URI
PLUGIN_URI
HEADER_PREFIX
write()
processRecord()
getDefaultFormatter()
createHeader()
createRecordHeader()
getInitHeaders()
sendHeader()
headersAccepted()
$level
$bubble
$formatter
$processors
$initialized
$messageIndex
$sendHeaders
N/A
No private methods found
No private properties found
N/A

Constants

PROTOCOL_URI

PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'

WildFire JSON header message format

STRUCTURE_URI

STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'

FirePHP structure for parsing messages & their presentation

PLUGIN_URI

PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'

Must reference a "known" plugin, otherwise headers won't display in FirePHP

HEADER_PREFIX

HEADER_PREFIX = 'X-Wf'

Header prefix for Wildfire to recognize & parse headers

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$initialized

$initialized : 

Whether or not Wildfire vendor-specific headers have been generated & sent yet

Type

$messageIndex

$messageIndex : integer

Shared static message index between potentially multiple handlers

Type

integer

$sendHeaders

$sendHeaders : 

Type

Methods

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

__construct()

__construct(integer  $level = \Monolog\Logger::DEBUG, Boolean  $bubble = true) 

Parameters

integer $level

The minimum logging level at which this handler will be triggered

Boolean $bubble

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

isHandling()

isHandling(array  $record) : Boolean

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

This is mostly done for performance reasons, to avoid calling processors for nothing.

Parameters

array $record

Returns

Boolean

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() 

Closes the handler.

This will be called automatically when the object is destroyed

pushProcessor()

pushProcessor(callable  $callback) 

Adds a processor in the stack.

Parameters

callable $callback

popProcessor()

popProcessor() : callable

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

Returns

callable

setLevel()

setLevel(integer  $level) 

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

Parameters

integer $level

getLevel()

getLevel() : integer

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

Returns

integer

setBubble()

setBubble(Boolean  $bubble) 

Sets the bubbling behavior.

Parameters

Boolean $bubble

True means that bubbling is not permitted. False means that this handler allows bubbling.

getBubble()

getBubble() : Boolean

Gets the bubbling behavior.

Returns

Boolean —

True means that bubbling is not permitted. False means that this handler allows bubbling.

__destruct()

__destruct() 

write()

write(array  $record) : void

Creates & sends header for a record, ensuring init headers have been sent prior

Parameters

array $record

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array

getDefaultFormatter()

getDefaultFormatter() 

{@inheritDoc}

createHeader()

createHeader(array  $meta, string  $message) : array

Base header creation function used by init headers & record headers

Parameters

array $meta

Wildfire Plugin, Protocol & Structure Indexes

string $message

Log message

Returns

array —

Complete header string ready for the client as key and message as value

createRecordHeader()

createRecordHeader(array  $record) : string

Creates message header from record

Parameters

array $record

Returns

string

getInitHeaders()

getInitHeaders() : array

Wildfire initialization headers to enable message parsing

Returns

array

sendHeader()

sendHeader(string  $header, string  $content) 

Send header string to the client

Parameters

string $header
string $content

headersAccepted()

headersAccepted() : Boolean

Verifies if the headers are accepted by the current user agent

Returns

Boolean