Skip to content

Commit

Permalink
Log middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Mar 26, 2020
1 parent 8f13914 commit 54d87aa
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/Rackbeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,35 @@ class Rackbeat
/**
* Rackbeat constructor.
*
* @param null $token API token
* @param null $token API token
* @param array $options Custom Guzzle options
* @param array $headers Custom Guzzle headers
* @param bool $enable_log
* @param null $log_path
*/
public function __construct( $token = null, $options = [], $headers = [] )
public function __construct($token = null, $options = [], $headers = [], $enable_log = false, $log_path = null)
{
$this->initRequest( $token, $options, $headers );
$this->initRequest($token, $options, $headers, $enable_log, $log_path);
}

private function initRequest( $token, $options = [], $headers = [] )
/**
* @param $token
* @param array $options
* @param array $headers
* @param bool $enable_log
* @param null $log_path
*/
private function initRequest($token, $options = [], $headers = [], $enable_log = false, $log_path = null)
{
$this->request = new Request( $token, $options, $headers );
$this->request = new Request($token, $options, $headers, $enable_log, $log_path);
}

/**
* @return \Rackbeat\Builders\SupplierBuilder
*/
public function suppliers()
{
return new SupplierBuilder( $this->request );
return new SupplierBuilder($this->request);
}

public function supplierGroups()
Expand Down

0 comments on commit 54d87aa

Please sign in to comment.