Switched print to logging, support log level arg for debugging