Added logging mechanism to printer.
Extended tests.