PHP Class Clockwork\Clockwork

Inheritance: implements Psr\Log\LoggerInterface
Mostra file Open project: itsgoingd/clockwork Class Usage Examples

Protected Properties

Property Type Description
$dataSources Array of data sources, these objects provide data to be stored in a request object
$log Request\Log instance, data structure which stores data for the log view
$request Request object, data structure which stores data about current application request
$storage Storage object, provides implementation for storing and retrieving request objects
$timeline Request\Timeline instance, data structure which stores data for the timeline view

Public Methods

Method Description
__construct ( ) Create a new Clockwork instance with default request object
addDataSource ( Clockwork\DataSource\DataSourceInterface $dataSource ) Add a new data source
alert ( $message, array $context = [] )
critical ( $message, array $context = [] )
debug ( $message, array $context = [] )
emergency ( $message, array $context = [] )
endEvent ( $name )
error ( $message, array $context = [] )
getDataSources ( ) Return array of all added data sources
getLog ( ) Return the log instance
getRequest ( ) Return the request object
getStorage ( ) Return the storage object
getTimeline ( ) Return the timeline instance
info ( $message, array $context = [] )
log ( $level = LogLevel::INFO, $message, array $context = [] ) Shortcut methods for the current log instance
notice ( $message, array $context = [] )
resolveRequest ( ) Add data from all data sources to request
setLog ( Log $log ) Set a custom log instance
setRequest ( Request $request ) Set a custom request object
setStorage ( Clockwork\Storage\StorageInterface $storage ) Set a custom storage object
setTimeline ( Timeline $timeline ) Set a custom timeline instance
startEvent ( $name, $description, $time = null ) Shortcut methods for the current timeline instance
storeRequest ( ) Store request via storage object
warning ( $message, array $context = [] )

Method Details

__construct() public method

Create a new Clockwork instance with default request object
public __construct ( )

addDataSource() public method

Add a new data source
public addDataSource ( Clockwork\DataSource\DataSourceInterface $dataSource )
$dataSource Clockwork\DataSource\DataSourceInterface

alert() public method

public alert ( $message, array $context = [] )
$context array

critical() public method

public critical ( $message, array $context = [] )
$context array

debug() public method

public debug ( $message, array $context = [] )
$context array

emergency() public method

public emergency ( $message, array $context = [] )
$context array

endEvent() public method

public endEvent ( $name )

error() public method

public error ( $message, array $context = [] )
$context array

getDataSources() public method

Return array of all added data sources
public getDataSources ( )

getLog() public method

Return the log instance
public getLog ( )

getRequest() public method

Return the request object
public getRequest ( )

getStorage() public method

Return the storage object
public getStorage ( )

getTimeline() public method

Return the timeline instance
public getTimeline ( )

info() public method

public info ( $message, array $context = [] )
$context array

log() public method

Shortcut methods for the current log instance
public log ( $level = LogLevel::INFO, $message, array $context = [] )
$context array

notice() public method

public notice ( $message, array $context = [] )
$context array

resolveRequest() public method

Add data from all data sources to request
public resolveRequest ( )

setLog() public method

Set a custom log instance
public setLog ( Log $log )
$log Clockwork\Request\Log

setRequest() public method

Set a custom request object
public setRequest ( Request $request )
$request Clockwork\Request\Request

setStorage() public method

Set a custom storage object
public setStorage ( Clockwork\Storage\StorageInterface $storage )
$storage Clockwork\Storage\StorageInterface

setTimeline() public method

Set a custom timeline instance
public setTimeline ( Timeline $timeline )
$timeline Clockwork\Request\Timeline

startEvent() public method

Shortcut methods for the current timeline instance
public startEvent ( $name, $description, $time = null )

storeRequest() public method

Store request via storage object
public storeRequest ( )

warning() public method

public warning ( $message, array $context = [] )
$context array

Property Details

$dataSources protected_oe property

Array of data sources, these objects provide data to be stored in a request object
protected $dataSources

$log protected_oe property

Request\Log instance, data structure which stores data for the log view
protected $log

$request protected_oe property

Request object, data structure which stores data about current application request
protected $request

$storage protected_oe property

Storage object, provides implementation for storing and retrieving request objects
protected $storage

$timeline protected_oe property

Request\Timeline instance, data structure which stores data for the timeline view
protected $timeline