From 7f631c41bf22689e59dc9a325b6820b487a61d22 Mon Sep 17 00:00:00 2001 From: mpmiszczyk <1692426+mpmiszczyk@users.noreply.github.com> Date: Wed, 22 May 2024 17:02:29 +0200 Subject: [PATCH 1/2] Use new logger standard --- lib/grpc/adapter/cowboy/handler.ex | 4 ++-- lib/grpc/server/supervisor.ex | 6 ++++-- lib/grpc/stub.ex | 2 +- lib/grpc/transport/http2.ex | 2 +- test/support/integration_test_case.ex | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/grpc/adapter/cowboy/handler.ex b/lib/grpc/adapter/cowboy/handler.ex index 8ccb4e3c..31830488 100644 --- a/lib/grpc/adapter/cowboy/handler.ex +++ b/lib/grpc/adapter/cowboy/handler.ex @@ -171,7 +171,7 @@ defmodule GRPC.Adapter.Cowboy.Handler do {:ok, req, state} catch :exit, :timeout -> - Logger.warn("Timeout when reading full body") + Logger.warning("Timeout when reading full body") info({:handling_timeout, self()}, req, state) end @@ -472,7 +472,7 @@ defmodule GRPC.Adapter.Cowboy.Handler do defp extract_subtype(<<"application/grpc;", rest::binary>>), do: {:ok, rest} defp extract_subtype(type) do - Logger.warn("Got unknown content-type #{type}, please create an issue.") + Logger.warning("Got unknown content-type #{type}, please create an issue.") {:ok, "proto"} end diff --git a/lib/grpc/server/supervisor.ex b/lib/grpc/server/supervisor.ex index c380a3e0..0d1c2c0a 100644 --- a/lib/grpc/server/supervisor.ex +++ b/lib/grpc/server/supervisor.ex @@ -74,7 +74,7 @@ defmodule GRPC.Server.Supervisor do {endpoint, endpoint.__meta__(:servers)} rescue FunctionClauseError -> - Logger.warn( + Logger.warning( "deprecated: servers as argument of GRPC.Server.Supervisor, please use GRPC.Endpoint" ) @@ -99,7 +99,9 @@ defmodule GRPC.Server.Supervisor do ver = to_string(vsn) unless Version.match?(ver, ">= 2.9.0") do - Logger.warn("cowlib should be >= 2.9.0, it's #{ver} now. See grpc's README for details") + Logger.warning( + "cowlib should be >= 2.9.0, it's #{ver} now. See grpc's README for details" + ) end _ -> diff --git a/lib/grpc/stub.ex b/lib/grpc/stub.ex index 820172a4..a94dd34c 100644 --- a/lib/grpc/stub.ex +++ b/lib/grpc/stub.ex @@ -640,7 +640,7 @@ defmodule GRPC.Stub do end defp parse_req_opts([{:content_type, content_type} | t], acc) do - Logger.warn(":content_type has been deprecated, please use :codec") + Logger.warning(":content_type has been deprecated, please use :codec") parse_req_opts(t, Map.put(acc, :content_type, content_type)) end diff --git a/lib/grpc/transport/http2.ex b/lib/grpc/transport/http2.ex index 5d4fdcb9..c4222e72 100644 --- a/lib/grpc/transport/http2.ex +++ b/lib/grpc/transport/http2.ex @@ -98,7 +98,7 @@ defmodule GRPC.Transport.HTTP2 do end defp append_encoding(headers, grpc_encoding) when is_binary(grpc_encoding) do - Logger.warn("grpc_encoding option is deprecated, please use compressor.") + Logger.warning("grpc_encoding option is deprecated, please use compressor.") [{"grpc-encoding", grpc_encoding} | headers] end diff --git a/test/support/integration_test_case.ex b/test/support/integration_test_case.ex index df1daaa3..f9fec591 100644 --- a/test/support/integration_test_case.ex +++ b/test/support/integration_test_case.ex @@ -37,7 +37,7 @@ defmodule GRPC.Integration.TestCase do result {:error, :eaddrinuse} -> - Logger.warn("Got eaddrinuse when reconnecting to #{server}:#{port}. retry: #{retry}") + Logger.warning("Got eaddrinuse when reconnecting to #{server}:#{port}. retry: #{retry}") if retry >= 1 do Process.sleep(500) From b76abc108f7ee607c2824f22129deaf3df7a95ff Mon Sep 17 00:00:00 2001 From: mpmiszczyk <1692426+mpmiszczyk@users.noreply.github.com> Date: Wed, 22 May 2024 17:03:15 +0200 Subject: [PATCH 2/2] New release --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 6710f48b..7fcf804f 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule GRPC.Mixfile do def project do [ app: :grpc, - version: "0.6.4", + version: "0.7", elixir: "~> 1.5", elixirc_paths: elixirc_paths(Mix.env()), build_embedded: Mix.env() == :prod,