Added lib/logsetup

Sets up logging in an easy way.
Added tests for lib/logsetup.