diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7f24e4..7682af2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - otp: [22.x, 23.x, 24.x] - elixir: [1.10.x, 1.11.x] + otp: ['24.3.4.17', '25.3.2.12', '26.2.5'] + elixir: ['1.15.8', '1.16.3'] steps: - uses: actions/checkout@v2 - name: Set up Elixir - uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24 + uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} diff --git a/config/config.exs b/config/config.exs index 67ff526..af7ae42 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,6 +1,6 @@ # This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. -use Mix.Config +import Config # This configuration is loaded before any dependency and is restricted # to this project. If another project depends on this project, this @@ -22,6 +22,6 @@ use Mix.Config # here (which is why it is important to import them last). # -import_config "#{Mix.env}.exs" +import_config "#{config_env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index 4e3dbd9..b1e332a 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -1,11 +1,11 @@ -use Mix.Config +import Config config :logger, utc_log: true, truncate: 8192, sync_threshold: 40, discard_threshold_for_error_logger: 500, - compile_time_purge_level: :debug, + compile_time_purge_matching: [[level_lower_than: :debug]], backends: [ {ExSyslogger, :ex_syslogger_error}, {ExSyslogger, :ex_syslogger_debug}, diff --git a/config/prod.exs b/config/prod.exs index d2d855e..becde76 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -1 +1 @@ -use Mix.Config +import Config diff --git a/config/test.exs b/config/test.exs index 2c05571..02d2665 100644 --- a/config/test.exs +++ b/config/test.exs @@ -1,11 +1,11 @@ -use Mix.Config +import Config config :logger, utc_log: true, truncate: 8192, sync_threshold: 40, discard_threshold_for_error_logger: 500, - compile_time_purge_level: :debug, + compile_time_purge_matching: [[level_lower_than: :debug]], backends: [ {ExSyslogger, :ex_syslogger_error}, {ExSyslogger, :ex_syslogger_debug}, @@ -14,12 +14,12 @@ config :logger, config :logger, :console, level: :error, - format: "$date $time [$level] $levelpad$node $metadata $message\n", + format: "$date $time [$level] $node $metadata $message\n", metadata: [:module, :line, :function] config :logger, :ex_syslogger_error, level: :error, - format: "$date $time [$level] $levelpad$node $metadata $message", + format: "$date $time [$level] $node $metadata $message", metadata: [:module, :line, :function], ident: "MyApplication Error", facility: :local0, diff --git a/examples/example1/config/config.exs b/examples/example1/config/config.exs index 6b604ec..4a39a52 100644 --- a/examples/example1/config/config.exs +++ b/examples/example1/config/config.exs @@ -28,7 +28,7 @@ config :logger, truncate: 8192, sync_threshold: 40, discard_threshold_for_error_logger: 500, - compile_time_purge_level: :debug, + compile_time_purge_matching: [[level_lower_than: :debug]], backends: [ :console, {ExSyslogger, :ex_syslogger_error}, diff --git a/test/exsyslog_test.exs b/test/exsyslog_test.exs index 043c2e8..980f5fc 100644 --- a/test/exsyslog_test.exs +++ b/test/exsyslog_test.exs @@ -2,20 +2,21 @@ defmodule ExsyslogTest do use ExUnit.Case require Logger + test "different level of logs" do debug_log = "debug log #{random_str()}" - Logger.debug debug_log + Logger.debug(debug_log) info_log = "info log #{random_str()}" - Logger.info info_log + Logger.info(info_log) error_log = "error log #{random_str()}" - Logger.error error_log + Logger.error(error_log) end def random_str do 18 - |> :crypto.strong_rand_bytes - |> Base.encode16 + |> :crypto.strong_rand_bytes() + |> Base.encode16() end end