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

Add --log-level to ecto.migrate and ecto.rollback #543

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

whatyouhide
Copy link
Contributor

We do support the :log option, but that's only for things that Ecto itself logs. If, for example, adapters log something at the debug level (regardless of whether that's a good idea or not), then it'll get logged because we are not configuring the log level anywhere.

cc @josevalim

@@ -117,6 +124,9 @@ defmodule Mix.Tasks.Ecto.Rollback do
do: Keyword.merge(opts, log: false, log_migrations_sql: false, log_migrator_sql: false),
else: opts

log_level = String.to_existing_atom(Keyword.get(opts, :log_level, "debug"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do it conditionally, as above, in case the user does call it after their application is started.

@josevalim josevalim merged commit 1b97dfc into elixir-ecto:master Jul 27, 2023
9 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@whatyouhide whatyouhide deleted the log-level branch July 27, 2023 15:57
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

Successfully merging this pull request may close these issues.

3 participants