mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Update identify_push_demo.py for double print and debug msgs
This commit is contained in:
@ -35,10 +35,6 @@ from libp2p.peer.peerinfo import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Configure logging
|
# Configure logging
|
||||||
# logging.basicConfig(
|
|
||||||
# level=logging.DEBUG,
|
|
||||||
# format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
||||||
# )
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -100,28 +96,17 @@ async def main() -> None:
|
|||||||
if success:
|
if success:
|
||||||
logger.info("Identify push completed successfully")
|
logger.info("Identify push completed successfully")
|
||||||
print("Identify push completed successfully!")
|
print("Identify push completed successfully!")
|
||||||
|
|
||||||
logger.info("Example completed successfully")
|
|
||||||
print("\nExample completed successfully!")
|
|
||||||
else:
|
else:
|
||||||
logger.warning("Identify push didn't complete successfully")
|
logger.warning("Identify push didn't complete successfully")
|
||||||
print("\nWarning: Identify push didn't complete successfully")
|
print("\nWarning: Identify push didn't complete successfully")
|
||||||
|
|
||||||
logger.warning("Example completed with warnings")
|
|
||||||
print("Example completed with warnings")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error during identify push: {str(e)}")
|
logger.error(f"Error during identify push: {str(e)}")
|
||||||
print(f"\nError during identify push: {str(e)}")
|
print(f"\nError during identify push: {str(e)}")
|
||||||
|
|
||||||
logger.error("Example completed with errors")
|
|
||||||
print("Example completed with errors")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
trio.run(main)
|
trio.run(main)
|
||||||
|
|
||||||
|
|
||||||
# Non-async entry point for console script
|
|
||||||
def run_main():
|
def run_main():
|
||||||
"""Non-async entry point for the console script."""
|
"""Non-async entry point for the console script."""
|
||||||
trio.run(main)
|
trio.run(main)
|
||||||
|
|||||||
Reference in New Issue
Block a user