File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use GuzzleHttp \Client ;
6
6
use GuzzleHttp \HandlerStack ;
7
+ use GuzzleHttp \Middleware as GuzzleMiddleware ;
7
8
use OpenStack \Common \Service \Builder ;
8
9
use OpenStack \Common \Transport \Utils ;
9
10
use OpenStack \Identity \v3 \Service ;
@@ -54,9 +55,18 @@ private function getDefaultIdentityService(array $options): Service
54
55
throw new \InvalidArgumentException ("'authUrl' is a required option " );
55
56
}
56
57
58
+ $ stack = HandlerStack::create ();
59
+
60
+ if (!empty ($ options ['debugLog ' ])
61
+ && !empty ($ options ['logger ' ])
62
+ && !empty ($ options ['messageFormatter ' ])
63
+ ) {
64
+ $ stack ->push (GuzzleMiddleware::log ($ options ['logger ' ], $ options ['messageFormatter ' ]));
65
+ }
66
+
57
67
$ clientOptions = [
58
68
'base_uri ' => Utils::normalizeUrl ($ options ['authUrl ' ]),
59
- 'handler ' => HandlerStack:: create (),
69
+ 'handler ' => $ stack
60
70
];
61
71
62
72
if (isset ($ options ['requestOptions ' ])) {
You can’t perform that action at this time.
0 commit comments