remove emojis from console
This commit is contained in:
@@ -50,22 +50,22 @@ class BinanceExample:
|
||||
|
||||
def on_status_changed(self, exchange, status):
|
||||
"""Handle status changes"""
|
||||
logger.info(f"🔄 {exchange} status changed to: {status.value}")
|
||||
logger.info(f" {exchange} status changed to: {status.value}")
|
||||
|
||||
async def run_example(self):
|
||||
"""Run the example"""
|
||||
try:
|
||||
logger.info("🚀 Starting Binance connector example")
|
||||
logger.info(" Starting Binance connector example")
|
||||
|
||||
# Connect to Binance
|
||||
logger.info("🔌 Connecting to Binance...")
|
||||
connected = await self.connector.connect()
|
||||
|
||||
if not connected:
|
||||
logger.error("❌ Failed to connect to Binance")
|
||||
logger.error(" Failed to connect to Binance")
|
||||
return
|
||||
|
||||
logger.info("✅ Connected to Binance successfully")
|
||||
logger.info(" Connected to Binance successfully")
|
||||
|
||||
# Get available symbols
|
||||
logger.info("📋 Getting available symbols...")
|
||||
@@ -94,12 +94,12 @@ class BinanceExample:
|
||||
if 'BTCUSDT' in symbols:
|
||||
await self.connector.subscribe_orderbook('BTCUSDT')
|
||||
await self.connector.subscribe_trades('BTCUSDT')
|
||||
logger.info("✅ Subscribed to BTCUSDT order book and trades")
|
||||
logger.info(" Subscribed to BTCUSDT order book and trades")
|
||||
|
||||
# Subscribe to ETH order book
|
||||
if 'ETHUSDT' in symbols:
|
||||
await self.connector.subscribe_orderbook('ETHUSDT')
|
||||
logger.info("✅ Subscribed to ETHUSDT order book")
|
||||
logger.info(" Subscribed to ETHUSDT order book")
|
||||
|
||||
# Let it run for a while
|
||||
logger.info("⏳ Collecting data for 30 seconds...")
|
||||
@@ -111,7 +111,7 @@ class BinanceExample:
|
||||
logger.info(f" 📊 Order books received: {self.orderbook_count}")
|
||||
logger.info(f" 💰 Trades received: {self.trade_count}")
|
||||
logger.info(f" 📡 Total messages: {stats['message_count']}")
|
||||
logger.info(f" ❌ Errors: {stats['error_count']}")
|
||||
logger.info(f" Errors: {stats['error_count']}")
|
||||
logger.info(f" 🔗 Active streams: {stats['active_streams']}")
|
||||
logger.info(f" 📋 Subscriptions: {list(stats['subscriptions'].keys())}")
|
||||
|
||||
@@ -126,12 +126,12 @@ class BinanceExample:
|
||||
await self.connector.unsubscribe_orderbook('ETHUSDT')
|
||||
|
||||
await self.connector.disconnect()
|
||||
logger.info("✅ Disconnected successfully")
|
||||
logger.info(" Disconnected successfully")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logger.info("⏹️ Interrupted by user")
|
||||
except Exception as e:
|
||||
logger.error(f"❌ Example failed: {e}")
|
||||
logger.error(f" Example failed: {e}")
|
||||
finally:
|
||||
# Ensure cleanup
|
||||
try:
|
||||
@@ -164,5 +164,5 @@ if __name__ == "__main__":
|
||||
except KeyboardInterrupt:
|
||||
print("\n👋 Example stopped by user")
|
||||
except Exception as e:
|
||||
print(f"\n❌ Example failed: {e}")
|
||||
print(f"\n Example failed: {e}")
|
||||
sys.exit(1)
|
||||
@@ -78,11 +78,11 @@ class MultiExchangeManager:
|
||||
# Report results
|
||||
for i, (name, result) in enumerate(zip(self.connectors.keys(), results)):
|
||||
if isinstance(result, Exception):
|
||||
logger.error(f"❌ Failed to connect to {name}: {result}")
|
||||
logger.error(f" Failed to connect to {name}: {result}")
|
||||
elif result:
|
||||
logger.info(f"✅ Connected to {name}")
|
||||
logger.info(f" Connected to {name}")
|
||||
else:
|
||||
logger.warning(f"⚠️ Connection to {name} returned False")
|
||||
logger.warning(f" Connection to {name} returned False")
|
||||
|
||||
async def _connect_exchange(self, name: str, connector) -> bool:
|
||||
"""Connect to a single exchange."""
|
||||
@@ -111,7 +111,7 @@ class MultiExchangeManager:
|
||||
# Small delay between subscriptions
|
||||
await asyncio.sleep(0.5)
|
||||
else:
|
||||
logger.warning(f"⚠️ {name} not connected, skipping {symbol}")
|
||||
logger.warning(f" {name} not connected, skipping {symbol}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error subscribing to {symbol} on {name}: {e}")
|
||||
@@ -152,7 +152,7 @@ class MultiExchangeManager:
|
||||
for name, connector in self.connectors.items():
|
||||
try:
|
||||
await connector.disconnect()
|
||||
logger.info(f"✅ Disconnected from {name}")
|
||||
logger.info(f" Disconnected from {name}")
|
||||
except Exception as e:
|
||||
logger.error(f"Error disconnecting from {name}: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user