2121from kraken .exceptions import KrakenException
2222
2323if TYPE_CHECKING :
24- # to avoid circular import for type checking
2524 from kraken .futures import KrakenFuturesWSClient
2625
2726
@@ -89,10 +88,10 @@ async def __run(self: ConnectFuturesWebsocket, event: asyncio.Event) -> None:
8988 try :
9089 _msg = await asyncio .wait_for (self .__socket .recv (), timeout = 15 )
9190 except asyncio .TimeoutError :
92- logging .debug (
93- "Timeout error in {endpoint} " ,
94- extra = { "endpoint" : self .__ws_endpoint } ,
95- ) # important
91+ logging .debug ( # important
92+ "Timeout error in %s " ,
93+ self .__ws_endpoint ,
94+ )
9695 except asyncio .CancelledError :
9796 logging .exception ("asyncio.CancelledError" )
9897 keep_alive = False
@@ -138,8 +137,9 @@ async def __reconnect(self: ConnectFuturesWebsocket) -> None:
138137
139138 reconnect_wait : float = self .__get_reconnect_wait (self .__reconnect_num )
140139 logging .debug (
141- "asyncio sleep reconnect_wait={wait} s reconnect_num={num}" ,
142- extra = {"wait" : reconnect_wait , "num" : self .__reconnect_num },
140+ "asyncio sleep reconnect_wait=%f s reconnect_num=%d" ,
141+ reconnect_wait ,
142+ self .__reconnect_num ,
143143 )
144144 await asyncio .sleep (reconnect_wait )
145145 logging .debug ("asyncio sleep done" )
@@ -165,7 +165,7 @@ async def __reconnect(self: ConnectFuturesWebsocket) -> None:
165165 message = f"{ task } got an exception { task .exception ()} \n { task .get_stack ()} "
166166 logging .warning (message )
167167 for process in pending :
168- logging .warning ("pending {proc} " , extra = { "proc" : process } )
168+ logging .warning ("pending %s " , process )
169169 try :
170170 process .cancel ()
171171 except asyncio .CancelledError :
@@ -181,8 +181,8 @@ async def __recover_subscription_req_msg(
181181 event : asyncio .Event ,
182182 ) -> None :
183183 logging .info (
184- "Recover subscriptions {subscriptions} waiting." ,
185- extra = { "subscriptions" : self .__subscriptions } ,
184+ "Recover subscriptions %s waiting." ,
185+ self .__subscriptions ,
186186 )
187187 await event .wait ()
188188
@@ -191,11 +191,11 @@ async def __recover_subscription_req_msg(
191191 await self .send_message (deepcopy (sub ), private = True )
192192 elif sub ["feed" ] in self .__client .get_available_public_subscription_feeds ():
193193 await self .send_message (deepcopy (sub ), private = False )
194- logging .info ("{sub} : OK" , extra = { " sub" : sub } )
194+ logging .info ("%s : OK" , sub )
195195
196196 logging .info (
197- "Recover subscriptions {subscriptions} done." ,
198- extra = { "subscriptions" : self .__subscriptions } ,
197+ "Recover subscriptions %s done." ,
198+ self .__subscriptions ,
199199 )
200200
201201 async def send_message (
0 commit comments