Fix logging for mac and linux