use logging instead of stdout/err