Replace print statements with logging using mozlog

@whimboo 
This is to fix #26 
I think we have a bug here. We should only catch OSError exceptions here but not all possible ones. I would even add one more output, which shows the information why we failed. Maybe the one above should become a warning.