Adds log method

Simpler indeed and the OS differences are abstracted.