Add debug logging to function registration