Added basic logging support

Doesn't log properly, misses errors.