Skip to content

Commit

Permalink
UHF-9986: Make sure drush logger is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Apr 19, 2024
1 parent 8a6e098 commit 7227f54
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/HelfiApiBaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Drupal\monolog\Logger\Formatter\ConditionalFormatter;
use Drupal\monolog\Logger\Handler\ConditionalHandler;
use Drupal\monolog\Logger\Handler\DrupalHandler;
use Drush\Log\DrushLog;
use Monolog\Handler\StreamHandler;
use Symfony\Component\DependencyInjection\Reference;

Expand Down Expand Up @@ -36,6 +37,12 @@ public function register(ContainerBuilder $container) : void {
],
],
]);

if (!$container->has('logger.drupaltodrush')) {
$container->register('logger.drupaltodrush', DrushLog::class)
->addArgument(new Reference('logger.log_message_parser'))
->addTag('logger');
}
if (!$container->has('monolog.handler.drupal.drupaltodrush')) {
$container->register('monolog.handler.drupal.drupaltodrush', DrupalHandler::class)
->addArgument(new Reference('logger.drupaltodrush'))
Expand Down

0 comments on commit 7227f54

Please sign in to comment.