From 96d30bb554c8cad7fbb19848f8f7bf379d00be66 Mon Sep 17 00:00:00 2001 From: akash-akya Date: Fri, 2 Feb 2024 21:20:34 +0530 Subject: [PATCH] Fix logger macro deprecation warning --- lib/vix/vips/image.ex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vix/vips/image.ex b/lib/vix/vips/image.ex index 94900b6..e35aec7 100644 --- a/lib/vix/vips/image.ex +++ b/lib/vix/vips/image.ex @@ -491,7 +491,7 @@ defmodule Vix.Vips.Image do IO.iodata_to_binary(iodata) rescue ArgumentError -> - Logger.warn("argument must be stream of iodata") + log_warn("argument must be stream of iodata") Vix.SourcePipe.stop(pipe) exit(:normal) end @@ -1200,4 +1200,10 @@ defmodule Vix.Vips.Image do defp binary_to_list(binary, :VIPS_FORMAT_DOUBLE) do for <>, do: band end + + if Kernel.macro_exported?(Logger, :warning, 1) do + def log_warn(msg), do: Logger.warning(msg) + else + def log_warn(msg), do: Logger.warn(msg) + end end