-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
/** | ||
* {@inheritdoc} | ||
* | ||
* @var \Drupal\Core\Logger\ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
OPENEUROPA-1126