Skip to content

Commit

Permalink
Merge pull request #146 from akash-akya/dev
Browse files Browse the repository at this point in the history
Fix logger macro deprecation warning
  • Loading branch information
akash-akya authored Feb 2, 2024
2 parents 0fbbda8 + 68eacdd commit 2d0b20b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.7.x
otp: 22.x
- elixir: 1.8.x
otp: 22.x
- elixir: 1.9.x
otp: 22.x
- elixir: 1.10.x
Expand All @@ -25,10 +21,12 @@ jobs:
otp: 23.x
- elixir: 1.13.x
otp: 24.x
- elixir: 1.14.x
otp: 24.x
- elixir: 1.14.x
otp: 25.x
- elixir: 1.15.x
otp: 26.x
- elixir: 1.16.x
otp: 26.x
steps:
- uses: erlef/setup-beam@v1
with:
Expand Down Expand Up @@ -94,8 +92,8 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.14.x
otp: 25.x
- elixir: 1.16.x
otp: 26.x
steps:
- uses: erlef/setup-beam@v1
with:
Expand All @@ -111,8 +109,8 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.14.x
otp: 25.x
- elixir: 1.16.x
otp: 26.x
steps:
- uses: erlef/setup-beam@v1
with:
Expand Down Expand Up @@ -140,8 +138,8 @@ jobs:
strategy:
matrix:
include:
- elixir: 1.14.x
otp: 25.x
- elixir: 1.16.x
otp: 26.x
steps:
- uses: erlef/setup-beam@v1
with:
Expand Down
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 2d0b20b

Please sign in to comment.