Skip to content

Commit

Permalink
Fix logger macro deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed Feb 2, 2024
1 parent 0fbbda8 commit 96d30bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/vix/vips/image.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1200,4 +1200,10 @@ defmodule Vix.Vips.Image do
defp binary_to_list(binary, :VIPS_FORMAT_DOUBLE) do
for <<band::native-float-64 <- binary>>, 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

0 comments on commit 96d30bb

Please sign in to comment.