diff --git a/smells/common-mistakes.md b/smells/common-mistakes.md index 31f6e0e..90cdd26 100644 --- a/smells/common-mistakes.md +++ b/smells/common-mistakes.md @@ -1160,3 +1160,25 @@ end **Why it's OK here:** There's no conditional logic — every iteration tests the exact same behavior with a trivially predictable result. If one fails, the assertion message includes the specific value. The loop is purely for conciseness. + +--- + +## Logger.warn/2 is Deprecated + +**Smell:** Using `Logger.warn/2` instead of `Logger.warning/2` + +**Why it's wrong:** `Logger.warn/2` was deprecated in Elixir 1.11. The standard function is `Logger.warning/2`. + +**Example — broken:** +```elixir +Logger.warn("Connection lost: #{reason}") +``` + +**Example — fixed:** +```elixir +Logger.warning("Connection lost: #{reason}") +``` + +**Source:** [Elixir 1.11 Changelog](https://hexdocs.pm/elixir/1.11/changelog.html#logger-improvements) + +