Use logging instead of print
Add option to log to file