5
5
use Aws \DynamoDb \DynamoDbClient ;
6
6
use Aws \DynamoDb \Exception \DynamoDbException ;
7
7
use Drupal \Core \Logger \LoggerChannelInterface ;
8
+ use Drupal \Core \Logger \LoggerChannelTrait ;
8
9
use Drupal \Core \Site \Settings ;
9
10
10
11
/**
14
15
*/
15
16
class Connection implements DynamoDbInterface {
16
17
18
+ use LoggerChannelTrait;
19
+
17
20
/**
18
21
* The DynamoDB client factory.
19
22
*
@@ -40,7 +43,7 @@ class Connection implements DynamoDbInterface {
40
43
*
41
44
* @var \Drupal\Core\Logger\LoggerChannelInterface
42
45
*/
43
- protected LoggerChannelInterface $ loggerFactory ;
46
+ protected $ loggerChannel ;
44
47
45
48
/**
46
49
* Static cache for consistent read option.
@@ -305,7 +308,7 @@ public function deleteTable(array $params): bool {
305
308
*/
306
309
public function listTables (array $ params ): array {
307
310
try {
308
- $ this ->dynamoDb ->listTables ($ params );
311
+ $ response = $ this ->dynamoDb ->listTables ($ params );
309
312
}
310
313
catch (DynamoDbException $ e ) {
311
314
$ this ->logger ()->error ($ e );
@@ -368,10 +371,10 @@ protected function getBillingMode(string $table): array {
368
371
* The logger.
369
372
*/
370
373
protected function logger (): LoggerChannelInterface {
371
- if (!$ this ->loggerFactory ) {
372
- $ this ->loggerFactory = \Drupal:: service ( ' logger.factory ' )-> get ('dynamodb_client ' );
374
+ if (!$ this ->loggerChannel ) {
375
+ $ this ->loggerChannel = $ this -> getLogger ('dynamodb_client ' );
373
376
}
374
- return $ this ->loggerFactory ;
377
+ return $ this ->loggerChannel ;
375
378
}
376
379
377
380
}
0 commit comments