use logging instead of print

ref #44