From e75a97707dee906e33898f965207222ff382f252 Mon Sep 17 00:00:00 2001 From: Rodin Date: Sun, 10 May 2026 21:24:24 -0700 Subject: [PATCH] docs: add Logger.warn deprecation as common mistake --- smells/common-mistakes.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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) + +