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);
136
136
137
137
// request and response logged to file
138
138
$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');
139
143
```
Original file line number Diff line number Diff line change 3
3
namespace PulkitJalan \Requester ;
4
4
5
5
use GuzzleHttp \Client as GuzzleClient ;
6
- use GuzzleHttp \Subscriber \Log \Formatter ;
7
6
use GuzzleHttp \Subscriber \Log \LogSubscriber ;
8
7
use GuzzleHttp \Subscriber \Retry \RetrySubscriber ;
9
8
use PulkitJalan \Requester \Exceptions \InvalidUrlException ;
@@ -114,8 +113,8 @@ public function getGuzzleClient()
114
113
*/
115
114
public function addLogger ($ logger , $ format = 'CLF ' )
116
115
{
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 );
119
118
}
120
119
121
120
$ subscriber = new LogSubscriber ($ logger , $ format );
You can’t perform that action at this time.
0 commit comments