Add logging module

This is a common set of routines used to log messages.