Add a logging interface.

Not exactly made into common code as of yet though.