feat: use Logger instead of IO.puts in DB check (#5050)

* use Logger instead of IO.puts

* docs: update changelog

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
This commit is contained in:
Matthias Wirtz
2025-12-01 10:52:15 +01:00
committed by GitHub
parent ee2f165c1a
commit 9dfc24b245
2 changed files with 6 additions and 2 deletions

View File

@@ -6,6 +6,8 @@
### Improvements and bug fixes
- feat: use Logger instead of IO.puts in DB check (#5050 - @swiffer)
#### Build, CI, internal
#### Dashboards

View File

@@ -1,4 +1,6 @@
defmodule TeslaMate.DatabaseCheck do
require Logger
alias Ecto.Adapters.SQL
alias TeslaMate.Repo
@@ -51,7 +53,7 @@ defmodule TeslaMate.DatabaseCheck do
}) do
cond do
major > 1800 ->
IO.puts(
Logger.warning(
"PostgreSQL version #{version} is not officially tested or supported yet. Use at your own risk."
)
@@ -67,7 +69,7 @@ defmodule TeslaMate.DatabaseCheck do
raise "PostgreSQL version #{version} is not supported. Minimum required for #{div(major, 100)}.x is #{@version_requirements[major].min_version}."
true ->
IO.puts("PostgreSQL version #{version} is compatible (#{div(major, 100)}.x series).")
Logger.info("PostgreSQL version #{version} is compatible (#{div(major, 100)}.x series).")
end
end
end