Implemented better logging meganism