• Add $this->t() into the following logger messages:
    $ grep -rin "\->error('" 
    src/Traits/CloudContentEntityTrait.php:410:      $this->logger($channel)->error('@type: @label could not be @passive_operation.', [
    src/Traits/CloudContentEntityTrait.php:428:    $this->logger($channel)->error('@type: %label could not be @passive_operation.', [
    modules/tools/s3_to_k8s/s3_to_k8s.module:39:    $logger->error('The configuration aws_cloud is empty. Please select an AWS Cloud Provider in admin setting page.');
    modules/tools/s3_to_k8s/s3_to_k8s.module:45:    $logger->error('The configuration s3_bucket is empty. Please input a S3 Bucket in admin setting page.');
    modules/tools/s3_to_k8s/s3_to_k8s.module:51:    $logger->error('The configuration s3_path is empty. Please input a S3 Path in admin setting page.');
    modules/tools/s3_to_k8s/s3_to_k8s.module:59:    $logger->error('The configuration k8s_cluster is empty. Please select K8s Cluster in admin setting page.');
    modules/tools/k8s_to_s3/k8s_to_s3.module:74:    $logger->error('The configuration k8s_clusters is empty. Please select K8s Clusters in admin setting page.');
    modules/tools/k8s_to_s3/k8s_to_s3.module:80:    $logger->error('The configuration aws_cloud is empty. Please select an AWS Cloud Provider in admin setting page.');
    modules/tools/k8s_to_s3/k8s_to_s3.module:86:    $logger->error('The configuration s3_bucket is empty. Please input a S3 Bucket in admin setting page.');
    modules/cloud_service_providers/aws_cloud/src/Form/Ec2/ImageDeleteForm.php:87:      $this->logger($entity->getEntityType()->getProvider())->error('@type: @label could not be deleted.', [
    
    $ grep -rin "\->debug('" 
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:140:    \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:191:      \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:232:      \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:296:      \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:436:      \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:2706:    \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/aws_cloud/aws_cloud.module:3471:    \Drupal::logger('aws_cloud')->debug('No cloud context specified.');
    modules/cloud_service_providers/openstack/openstack.module:506:      \Drupal::logger('openstack')->debug('No cloud context specified.');
    modules/cloud_service_providers/openstack/openstack.module:547:      \Drupal::logger('openstack')->debug('No cloud context specified.');
    modules/cloud_service_providers/openstack/openstack.module:609:      \Drupal::logger('openstack')->debug('No cloud context specified.');
    modules/cloud_service_providers/openstack/openstack.module:785:    \Drupal::logger('openstack')->debug('No cloud context specified.');
    
    $ grep -rin "\->notice('" 
    src/Form/CloudServerTemplateRevisionRevertForm.php:140:    $this->logger('launch_template')->notice('Launch template: reverted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    src/Form/CloudConfigRevisionRevertForm.php:136:    $this->logger('cloud_config')->notice('Cloud service provider: reverted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    src/Form/CloudConfigRevisionDeleteForm.php:136:    $this->logger('cloud_config')->notice('Cloud service provider: deleted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    src/Form/CloudServerTemplateRevisionDeleteForm.php:140:    $this->logger('launch_template')->notice('Launch template: deleted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    src/Form/CloudProjectRevisionRevertForm.php:140:    $this->logger('content')->notice('Cloud project: reverted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    src/Form/CloudProjectRevisionDeleteForm.php:139:    $this->logger('content')->notice('Cloud project: deleted %title revision %revision.', ['%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId()]);
    modules/php
    cloud_budget/cloud_budget.module:66:    \Drupal::logger('cloud_budget')->notice('@type: updated %label.', [
    modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php:611:          $this->logger('k8s')->notice('@type: created %label.', [
    modules/cloud_service_providers/k8s/src/Plugin/cloud/server_template/K8sCloudServerTemplatePlugin.php:633:          $this->logger('k8s')->notice('@type: launched %label.', [
    modules/cloud_service_providers/k8s/k8s.module:1993:    \Drupal::logger('k8s')->notice('@type: deleted %label.', [
    

Comments

onotm created an issue. See original summary.

Pooja Ganjage’s picture

StatusFileSize
new11.91 KB

Hi,

I am applying patch for this issue.

$this->t() would not be apply in module file as it is procedural code support.

Kindly review this patch once.

Let me know for anything else.

Thanks.

Pooja Ganjage’s picture

Status: Active » Needs review
yas’s picture

Status: Needs review » Needs work

@pooja-ganjage

Thank you for making your contribution toward this issue. Unfortunately the patch didn't pass the DrupalCI test, so could you please re-create the patch? Also, we also need to t() function (not $this->t()) in *.module file.

onotm’s picture

onotm’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: add_t_function_into_logger_messages-3162532-5.patch, failed testing. View results

onotm’s picture

Status: Needs work » Needs review
StatusFileSize
new20.35 KB

Status: Needs review » Needs work

The last submitted patch, 8: add_t_function_into_logger_messages-3162532-8.patch, failed testing. View results

onotm’s picture

onotm’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
onotm’s picture

Status: Needs work » Needs review
StatusFileSize
new18.09 KB

For a moment, I tried reverting the changes to CloudContentEntityTrait.php, because the related tests were failing.

yas’s picture

Issue summary: View changes
StatusFileSize
new39.35 KB
new22.63 KB

@onotm

Thank you for updating the patch. I added t() functions and refactored the patch, so could you please review the attached?

onotm’s picture

Thank you for updating the patch, it looks good for me.

onotm’s picture

Status: Needs review » Reviewed & tested by the community
yas’s picture

@onotm

Thank you for your review. I'll merge the patch to 8.x-1.x, 8.x-2.x and 3.x. Closing this issue as Fixed.

yas’s picture

StatusFileSize
new40.15 KB

This patch will be applied to 8.x-1.x.

  • yas committed 35c5b20 on 8.x-1.x
    Issue #3162532 by onotm, yas, Pooja Ganjage: Add $this->t() into logger...

  • yas committed 03d6ba2 on 8.x-2.x authored by onotm
    Issue #3162532 by onotm, yas, Pooja Ganjage: Add $this->t() into logger...

  • yas committed 61baef9 on 3.x authored by onotm
    Issue #3162532 by onotm, yas, Pooja Ganjage: Add $this->t() into logger...
yas’s picture

Status: Reviewed & tested by the community » Fixed
yas’s picture

@all FYI,

  1. The patch at #14 includes the coding violation fix at #3163409.
  2. The patch at #18 includes both the coding violation fix and the patch itself at #3163409.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.