Skip to content

Commit

Permalink
Compatibility with Elixir v1.15 (#115)
Browse files Browse the repository at this point in the history
* Use static list instead of Logger.levels/0

Logger.levels/0 was just introduced in elixir v1.16

* Changes required elixir version to v1.15.1

* Adds elixir v1.15.1 to CI matrix

* Update mix.exs

---------

Co-authored-by: Andrew Dryga <andrew@dryga.com>
  • Loading branch information
kbredemeier and AndrewDryga authored May 17, 2024
1 parent f4202bc commit 75077a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
include:
- otp-version: 24.3
elixir-version: 1.16
- otp-version: 25
elixir-version: 1.15.1
- otp-version: 25
elixir-version: 1.16
check-formatted: true
Expand Down
2 changes: 1 addition & 1 deletion lib/logger_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule LoggerJSON do
* `:conn` - the `Plug.Conn` struct. This is useful when logging HTTP requests and responses,
each formatter may use it differently.
"""
@log_levels Logger.levels()
@log_levels [:error, :info, :debug, :emergency, :alert, :critical, :warning, :notice]
@log_level_strings Enum.map(@log_levels, &to_string/1)

@doc """
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule LoggerJSON.Mixfile do
[
app: :logger_json,
version: @version,
elixir: "~> 1.16",
elixir: "~> 1.16 or ~> 1.15.1",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [] ++ Mix.compilers(),
build_embedded: Mix.env() == :prod,
Expand Down

0 comments on commit 75077a9

Please sign in to comment.