snaphu-py icon indicating copy to clipboard operation
snaphu-py copied to clipboard

[Feature Request]: pipe `snaphu`'s logging through the `logging` module

Open scottstanie opened this issue 6 months ago • 0 comments

The current version runs snaphu in a subprocess and only captures stderr. Snaphu's logging all goes to stdout:

$ python test_conncomp_regrow.py > std_out.log
(mapping-311) staniewi:snaphu-py$ cat std_out.log
$ cat std_out.log

snaphu v2.0.6
19 parameters input from file /var/folders/hw/sj9hl8555s36n00t812twvcr0000gq/T/tmpl49af4b1/snaphu.conf (19 lines total)
Creating temporary directory /var/folders/hw/sj9hl8555s36n00t812twvcr0000gq/T/tmpl49af4b1/snaphu_tiles_23572
Unwrapping tile at row 0, column 0 (pid 23575)
Unwrapping tile at row 0, column 1 (pid 23577)
... (etc)

It would be nice to pipe this through python's logging so the application calling snaphu has better control of the formatting/location of the logs.

Multiple possible solutions here: https://stackoverflow.com/questions/4417546/constantly-print-subprocess-output-while-process-is-running

scottstanie avatar Dec 21 '23 17:12 scottstanie