Added logging mechanism
Added logging mechanism and misc improvements
Added retry of test_lab on failure of first attempt
Added try block