log instead of print [skip ci]
factorize some code between linux and osx