Toggle Channels module provides the possibility to toggle (enable/disable) some (or all) logger's channels thrown through Drupal and installed contrib/custom modules.

Sometimes, for several reasons, it is not possible to disable some modules' logs.
In this way, the Toggle Channels module, come in handy.

Project link

https://www.drupal.org/project/toggle_channels

Git instructions

git clone --branch '8.x-1.x' https://git.drupalcode.org/project/toggle_channels.git

Comments

reinchek created an issue. See original summary.

reinchek’s picture

Status: Active » Needs review
reinchek’s picture

avpaderno’s picture

Priority: Minor » Normal
Issue summary: View changes

Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smother review.

To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.

Since the project is being used for this application, for the time this application is open, only the user who created the application can commit code.

avpaderno’s picture

Status: Needs review » Needs work
  • What follows is a quick review of the project; it doesn't mean to be complete
  • Each review point doesn't show all the lines that should be changed; it shows a single example of what is wrong in the code
  • The review points are about code that doesn't follow the coding standards, contains possible security issue, or doesn't correctly use the Drupal API; they aren't listed in any particular order, not even in order of importance
/**
   * @return mixed
   */
  private function getLogChannels() {
    $database = \Drupal::database();
    $query = $database->select('watchdog', 'w');

    return $query->fields('w', ['type'])->distinct(true)
      ->execute()->fetchAll();
  }

Dependencies need to be injected in the create() method.

public function log($level, $message, array $context = []) {
    return true;
  }

  /**
   * {@inheritDoc}
   */
  public function info($message, array $context = []) {
    return true;
  }

The first method is missing the documentation comment; the other methods are returning the wrong value.

public function setContainer(ContainerInterface $container = NULL) {
  parent::setContainer($container);
}

A method that just calls the method defined from the parent class can be removed.

reinchek’s picture

Thank you for reviewing this module.
I have committed the necessary changes.

reinchek’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work
  /**
   * Tests that the home page loads with a 200 response.
   */
  public function testLoad() {
    $this->drupalGet(Url::fromRoute('<front>'));
    $this->assertSession()->statusCodeEquals(200);
  }

The test isn't testing the module, since it doesn't alter the front page. Furthermore, Drupal core already tests the front page load; there is no need for every module to repeat that test, since the Drupal core tests are executed when a module's test are executed.

reinchek’s picture

Sure @apaderno,
indeed that test was absolutely useless.
I have removed the test, I will plan for their implementation in future releases.

Thanks again for the review.

reinchek’s picture

Status: Needs work » Needs review
reinchek’s picture

Issue summary: View changes
avpaderno’s picture

Status: Needs review » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

reinchek’s picture

Thank you, for the great work you do for the community. I will give my best to do my part in the community!

Status: Fixed » Closed (fixed)

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