Added debug logging facility.