Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENEUROPA-1126: Use logger factory as a service. #12

Merged
merged 3 commits into from
Aug 23, 2018
Merged

Conversation

aritomelo
Copy link
Contributor

OPENEUROPA-1126

  • Use Logger factory as a service
  • Made all report messages from this module to be of type "oe_webtools"

/**
* {@inheritdoc}
*
* @var \Drupal\Core\Logger\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect namespace here in the docblock.

// Get id from settings.php!
$this->config = $configFactory->get(AnalyticsEventInterface::CONFIG_NAME);
$this->requestStack = $requestStack;
$this->loggerFactory = $loggerFactory;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not set logger factory in the class, but directly the channel.

$this->logger = $loggerFactory->get('oe_webtools');

And then you have $logger everywhere you need to log.

$factory
->get('default')
$this->loggerFactory
->get('oe_webtools')
->debug('The setting "' . AnalyticsEventInterface::SITE_ID . '" is missing from settings file.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a warning rather than debug no?

Copy link
Member

@ademarco ademarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@aritomelo aritomelo merged commit 70413e8 into master Aug 23, 2018
@aritomelo aritomelo deleted the OPENEUROPA-1126 branch August 23, 2018 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants