Hi,
The problem:
Search API accepts a Logger instance witch is restricted to \Drupal\Core\Logger\LoggerChannelInterface.
This forbids the use of any other logger, such as Monolog.
Reading class comments in LoggerChannelInterface:
This interface defines the full behavior of the central Drupal logger
facility. However, when writing code that does logging, use the generic
\Psr\Log\LoggerInterface for typehinting instead (you shouldn't need the
methods here).
It appears that methods of that interface are quite internal.
Proposed solution:
Replace \Drupal\Core\Logger\LoggerChannelInterface with \Psr\Log\LoggerInterface.
I guess the testbot should tell me if LoggerChannelInterface methods are effectively used.
The patch attached implements the proposed solution.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2733129-9--use_correct_logger_interface.patch | 5.85 KB | drunken monkey |
Comments
Comment #2
manu-manuComment #3
borisson_Let's see how the bot feels about this.
Comment #6
manu-manuDoh, I didn't noticed made this patch on 8.x-1.0-alpha14.
Will reroll a patch soon.
Comment #7
rajeshwari10 commentedI tried to reroll the patch but it always failed.
So done all the changes manually in Search API 8.x-1.x version.
Thanks!!
Comment #8
rajeshwari10 commentedComment #9
drunken monkeyThanks a lot, both of you – for pointing out this mistake and providing patches.
rajeshwari10, you forgot the
SearchApiRowclass, though. The attached patch fixes that class, too.If the test bot is happy with that, I'll commit it.
Comment #11
drunken monkeyCommitted.
Thanks again!
Comment #13
rajeshwari10 commented