From 7227f543788c3596f53647c15fa4acf5bfd14760 Mon Sep 17 00:00:00 2001 From: tuutti Date: Fri, 19 Apr 2024 17:22:18 +0300 Subject: [PATCH] UHF-9986: Make sure drush logger is defined --- src/HelfiApiBaseServiceProvider.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/HelfiApiBaseServiceProvider.php b/src/HelfiApiBaseServiceProvider.php index 65a4c28..3d74326 100644 --- a/src/HelfiApiBaseServiceProvider.php +++ b/src/HelfiApiBaseServiceProvider.php @@ -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; @@ -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'))