Implemented better logging support