Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ipfs log level #68

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading