Added generic logging mechanism