Merge pull request #6329 from blockscout/fix_logger_truncate_rust_verifier

Fix logger truncate rust verifier
pull/6339/head
Victor Baranov 2 years ago committed by GitHub
commit ddd72e44a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 8
      apps/explorer/lib/explorer/smart_contract/rust_verifier_interface.ex

@ -27,6 +27,7 @@
- [#6118](https://github.com/blockscout/blockscout/pull/6118) - Fix unfetched token balances
- [#6163](https://github.com/blockscout/blockscout/pull/6163) - Fix rate limit logs
- [#6223](https://github.com/blockscout/blockscout/pull/6223) - Fix coin_id test
- [#6133](https://github.com/blockscout/blockscout/pull/6133) - Prevent logger from truncating response from rust verifier service in case of an error
### Chore

@ -55,6 +55,9 @@ defmodule Explorer.SmartContract.RustVerifierInterface do
proccess_verifier_response(body)
{:error, error} ->
old_truncate = Application.get_env(:logger, :truncate)
Logger.configure(truncate: :infinity)
Logger.error(fn ->
[
"Error while sending request to verification microservice url: #{url}, body: #{inspect(body, limit: :infinity, printable_limit: :infinity)}: ",
@ -62,6 +65,7 @@ defmodule Explorer.SmartContract.RustVerifierInterface do
]
end)
Logger.configure(truncate: old_truncate)
{:error, @request_error_msg}
end
end
@ -75,6 +79,9 @@ defmodule Explorer.SmartContract.RustVerifierInterface do
{:error, body}
{:error, error} ->
old_truncate = Application.get_env(:logger, :truncate)
Logger.configure(truncate: :infinity)
Logger.error(fn ->
[
"Error while sending request to verification microservice url: #{url}: ",
@ -82,6 +89,7 @@ defmodule Explorer.SmartContract.RustVerifierInterface do
]
end)
Logger.configure(truncate: old_truncate)
{:error, @request_error_msg}
end
end

Loading…
Cancel
Save