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

Class "Consolidation\Log\ConsoleLogLevel" not found #5213

Closed
mglaman opened this issue Aug 20, 2022 · 9 comments
Closed

Class "Consolidation\Log\ConsoleLogLevel" not found #5213

mglaman opened this issue Aug 20, 2022 · 9 comments

Comments

@mglaman
Copy link
Contributor

mglaman commented Aug 20, 2022

Describe the bug
Drupal 10 + Drush 11 crashes due to

Error: Class "Consolidation\Log\ConsoleLogLevel" not found in Drush\Log\DrushLoggerManager->success()

See https://drupal.stackexchange.com/questions/311778/uncaught-error-class-consolidation-log-loglevel-not-found-in-app-vendor-con

Caused by consolidation/log@12d16fd

To Reproduce

composer create-project drupal/recommended-project:^10@alpha foobar
cd foobar
composer require drush/drush
php vendor/bin/drush si
omposer why consolidation/log
consolidation/robo  4.0.0-alpha1  requires  consolidation/log (^2.0.2 || ^3)

Expected behavior
It work.

Actual behavior
It go boom.

Workaround
Manually fix consolidation/log

System Configuration

Q A
Drush version? 11.1.1
Drupal version? 10.0.0-alpha7
PHP version 8.1.8
OS? macOS
consolidation/log 3.0.0
psr/log 3.0.0

Additional information
Add any other context about the problem here.

@mglaman
Copy link
Contributor Author

mglaman commented Aug 20, 2022

I've updated the config table to have consolidation/log and psr/log values.

@mglaman
Copy link
Contributor Author

mglaman commented Aug 20, 2022

🤔 I added "consolidation/log": ">=3" to my conflict, but then Drupal 10 was downgraded to alpha5.

@greg-1-anderson
Copy link
Member

I forgot about this. consolidation/log removed Consolidation\Log\ConsoleLogLevel in 3.x. Drush needs to stop using it that constant, and define its own success constant instead. I was going to make a PR, but I've been busy.

@mglaman
Copy link
Contributor Author

mglaman commented Aug 20, 2022

I see https://www.drupal.org/project/drupal/releases/10.0.0-alpha6, this bumped to psr/log 3. Only consolidation/log allows 3 of psr/log

@greg-1-anderson
Copy link
Member

Yeah, Drush adopted consolidation/log ^3 some time ago, but erroneously kept using the removed constant Consolidation\Log\ConsoleLogLevel. Drupal was holing Drush back to consolidation/log ^2, so no one noticed the mistake.

@greg-1-anderson
Copy link
Member

The tests seem to pass despite the error. 🤷

@gitressa
Copy link
Contributor

See also consolidation/log#31.

@greg-1-anderson
Copy link
Member

278e0dc does not apper to have fully resolved. See also #5247

@gitressa
Copy link
Contributor

Perfect @greg-1-anderson and @weitzman, Drupal 10 now installs nicely with the new Drush 11.2.0.

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

No branches or pull requests

3 participants