implement logging instead of printf
and logging to srt file

TODO: refactor into class and callable command-line script