Reformatting to PSR1/PSR2 standard
Change error logging to be optional

The default for the argument is to enable logging to maintain the same behaviour for existing code