Skip to content

Commit

Permalink
Change ipfs log level (#68)
Browse files Browse the repository at this point in the history
* Decrease log level

* Bump version 0.3.28
  • Loading branch information
evgeny-stakewise authored Oct 16, 2023
1 parent 42cb0f7 commit 544471d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "0.3.27"
version = "0.3.28"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down
4 changes: 2 additions & 2 deletions sw_utils/consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async def submit_voluntary_exit(

if i == len(self.base_urls) - 1:
raise error
logger.error('%s: %s', url, repr(error))
logger.warning('%s: %s', url, repr(error))

async def get_chain_finalized_head(self, slots_per_epoch: int) -> ChainHead:
"""Fetches the fork safe chain head."""
Expand Down Expand Up @@ -172,7 +172,7 @@ async def _async_make_get_request_inner(self, endpoint_uri: str) -> dict[str, An

if i == len(self.base_urls) - 1:
raise error
logger.error('%s: %s', url, repr(error))
logger.warning('%s: %s', url, repr(error))

return {}

Expand Down
4 changes: 2 additions & 2 deletions sw_utils/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def make_request_inner(self, method: RPCEndpoint, params: Any) -> RPCRespo
if i == len(self._providers) - 1:
raise error

logger.error('%s: %s', provider.endpoint_uri, repr(error))
logger.warning('%s: %s', provider.endpoint_uri, repr(error))

return {}

Expand Down Expand Up @@ -121,5 +121,5 @@ def get_execution_client(

if is_poa:
client.middleware_onion.inject(async_geth_poa_middleware, layer=0)
logger.info('Injected POA middleware')
logger.debug('Injected POA middleware')
return client
8 changes: 4 additions & 4 deletions sw_utils/ipfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async def _upload(self, coros: list) -> str:
ipfs_hashes: dict[str, int] = {}
for value in result:
if isinstance(value, BaseException):
logger.error(repr(value))
logger.warning(repr(value))
continue

ipfs_hash = _strip_ipfs_prefix(value)
Expand All @@ -239,7 +239,7 @@ async def remove(self, ipfs_hash: str) -> None:
)
for value in result:
if isinstance(value, BaseException):
logger.error(repr(value))
logger.warning(repr(value))
continue
return None

Expand All @@ -265,7 +265,7 @@ async def fetch_bytes(self, ipfs_hash: str) -> bytes:

return self._ipfs_fetch_bytes(endpoint, ipfs_hash)
except Exception as e:
logger.error(repr(e))
logger.warning(repr(e))

raise IpfsException(f'Failed to fetch IPFS data at {ipfs_hash}')

Expand Down Expand Up @@ -294,7 +294,7 @@ async def fetch_json(self, ipfs_hash: str) -> Any:

return self._ipfs_fetch_json(endpoint, ipfs_hash)
except Exception as e:
logger.error(repr(e))
logger.warning(repr(e))

raise IpfsException(f'Failed to fetch IPFS data at {ipfs_hash}')

Expand Down

0 comments on commit 544471d

Please sign in to comment.