Added a logging function, which only logs to stdout right now,
but its easy to change