Logging

Add basic logging to the read and write APIs