This repository was archived by the owner on Sep 6, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -136,4 +136,8 @@ $requester->addLogger($log);
136136
137137// request and response logged to file
138138$requester->url('example.com')->get();
139+
140+ // Use the second param to update the format
141+ $requester = new Requester(new GuzzleClient());
142+ $requester->addLogger($log, 'DEBUG');
139143```
Original file line number Diff line number Diff line change 33namespace PulkitJalan \Requester ;
44
55use GuzzleHttp \Client as GuzzleClient ;
6- use GuzzleHttp \Subscriber \Log \Formatter ;
76use GuzzleHttp \Subscriber \Log \LogSubscriber ;
87use GuzzleHttp \Subscriber \Retry \RetrySubscriber ;
98use PulkitJalan \Requester \Exceptions \InvalidUrlException ;
@@ -114,8 +113,8 @@ public function getGuzzleClient()
114113 */
115114 public function addLogger ($ logger , $ format = 'CLF ' )
116115 {
117- if (defined (Formatter::class. ' :: ' .$ format )) {
118- $ format = constant (Formatter::class. ' :: ' .$ format );
116+ if (defined (' GuzzleHttp\Subscriber\Log\Formatter :: ' .$ format )) {
117+ $ format = constant (' GuzzleHttp\Subscriber\Log\Formatter :: ' .$ format );
119118 }
120119
121120 $ subscriber = new LogSubscriber ($ logger , $ format );
You can’t perform that action at this time.
0 commit comments