@@ -202,6 +202,7 @@ def run_listing_tree(
202202 filetype : str | None ,
203203 depth : int = 1
204204) -> None :
205+ filetype = filetype or "unknown"
205206 console = Console (width = 120 )
206207 logger .info (
207208 f"Starting content listing of '{ directory } ' from '{ dev } ' device"
@@ -310,17 +311,13 @@ def main_download(
310311 large : bool = False
311312) -> None :
312313 logger = getLogger ("iman.files.download" )
313- logger .info (f"Starting connection on { port } " )
314- logger .debug (
315- f"Connection parameters: baud={ baud :d} , timeout={ timeout :d} , "
316- f"tries={ retry :d} , sync-after-timeout={ str (sync_after_timeout )} "
317- )
318314 with open_serial (
319315 port = port ,
320316 speed = baud ,
321317 timeout = timeout ,
322318 retry = retry ,
323- sync_after_timeout = sync_after_timeout
319+ sync_after_timeout = sync_after_timeout ,
320+ logger = logger .getChild ("com" )
324321 ) as com :
325322 tps = GeoCom (com , logger .getChild ("instrument" ))
326323 try :
@@ -337,8 +334,6 @@ def main_download(
337334 finally :
338335 tps .ftr .abort_download ()
339336
340- logger .info (f"Closed connection on { port } " )
341-
342337
343338def main_list (
344339 port : str ,
@@ -352,17 +347,13 @@ def main_list(
352347 depth : int = 1
353348) -> None :
354349 logger = getLogger ("iman.files.list" )
355- logger .info (f"Opening connection on { port } " )
356- logger .debug (
357- f"Connection parameters: baud={ baud :d} , timeout={ timeout :d} , "
358- f"tries={ retry :d} , sync-after-timeout={ str (sync_after_timeout )} "
359- )
360350 with open_serial (
361351 port = port ,
362352 speed = baud ,
363353 timeout = timeout ,
364354 retry = retry ,
365- sync_after_timeout = sync_after_timeout
355+ sync_after_timeout = sync_after_timeout ,
356+ logger = logger .getChild ("com" )
366357 ) as com :
367358 tps = GeoCom (com , logger .getChild ("instrument" ))
368359 try :
@@ -376,5 +367,3 @@ def main_list(
376367 )
377368 finally :
378369 tps .ftr .abort_listing ()
379-
380- logger .info (f"Closed connection on { port } " )
0 commit comments