Added logger factory. Fixes #22