Add support for initialization with a logger

The logger has to support .info .warn .error etc. If none is supplied
then console is used