@@ -75,7 +75,7 @@ def build(self):
75
75
def set_baud (self , baud ):
76
76
self .port .baudrate = baud
77
77
self .port .flush ()
78
- logger .debug ("baud rate set to {}" . format ( baud ) )
78
+ logger .debug ("baud rate set to %d" , baud )
79
79
80
80
def set_remote_baud (self , baud ):
81
81
_write_exactly (self .port , struct .pack (
@@ -89,7 +89,7 @@ def set_remote_baud(self, baud):
89
89
else :
90
90
# FIXME: when loading immediately after a board reset,
91
91
# we erroneously get some zeros back.
92
- logger .warning ("unexpected sync character: {: 02x}" . format ( int ( recv )) )
92
+ logger .warning ("unexpected sync character: % 02x" , recv )
93
93
handshake = 0
94
94
if recv != 0 :
95
95
fails += 1
@@ -112,9 +112,9 @@ def _get_device_msg(self):
112
112
for i in range (length ):
113
113
(c , ) = struct .unpack ("B" , _read_exactly (self .port , 1 ))
114
114
log_message += chr (c )
115
- logger .info ("DEVICE LOG: " + log_message )
115
+ logger .info ("DEVICE LOG: %s" , log_message )
116
116
else :
117
- logger .debug ("message received: {!r}" . format ( msg ) )
117
+ logger .debug ("message received: %r" , msg )
118
118
return msg
119
119
120
120
def get_runtime_env (self ):
@@ -134,7 +134,7 @@ def get_runtime_env(self):
134
134
">lBB" , _read_exactly (self .port , 6 ))
135
135
ref_freq = (ref_freq_i + Fraction (ref_freq_fn , ref_freq_fd ))* units .Hz
136
136
ref_period = 1 / ref_freq
137
- logger .debug ("environment ref_period: {}" . format ( ref_period ) )
137
+ logger .debug ("environment ref_period: %s" , ref_period )
138
138
return Environment (ref_period )
139
139
140
140
def switch_clock (self , external ):
@@ -160,7 +160,7 @@ def run(self, kname):
160
160
">lbl" , 0x5a5a5a5a , _H2DMsgType .RUN_KERNEL .value , len (kname )))
161
161
for c in kname :
162
162
_write_exactly (self .port , struct .pack (">B" , ord (c )))
163
- logger .debug ("running kernel: {}" . format ( kname ) )
163
+ logger .debug ("running kernel: %s" , kname )
164
164
165
165
def _receive_rpc_values (self ):
166
166
r = []
@@ -188,11 +188,11 @@ def _receive_rpc_values(self):
188
188
def _serve_rpc (self , rpc_map , user_exception_map ):
189
189
rpc_num = struct .unpack (">h" , _read_exactly (self .port , 2 ))[0 ]
190
190
args = self ._receive_rpc_values ()
191
- logger .debug ("rpc service: {} ({})" .format (rpc_num , args ))
192
- eid , r = self .rpc_wrapper .run_rpc (user_exception_map , rpc_map [rpc_num ], args )
191
+ logger .debug ("rpc service: %d %r" , rpc_num , args )
192
+ eid , r = self .rpc_wrapper .run_rpc (
193
+ user_exception_map , rpc_map [rpc_num ], args )
193
194
_write_exactly (self .port , struct .pack (">ll" , eid , r ))
194
- logger .debug ("rpc service: {} ({}) == {}" .format (
195
- rpc_num , args , r ))
195
+ logger .debug ("rpc service: %d %r == %r" , rpc_num , args , r )
196
196
197
197
def _serve_exception (self , user_exception_map ):
198
198
eid , p0 , p1 , p2 = struct .unpack (">lqqq" ,
0 commit comments