Add improved logging system