When adding warnings/logs, treat them as part of the user experience: only emit warnings when they are actionable, accurate, and non-noisy—especially when runtime feature detection changes behavior.
Guidelines:
hasattr on an SDK operation group) that can silently change behavior, log a warning when the guarded path is unavailable so users can understand why an expected lookup/action didn’t happen.Example pattern (behavior-guard warning):
if not hasattr(cert_orders_client, 'app_service_certificate_orders'):
logger.warning(
"Certificate orders operation group is unavailable in the current SDK. "
"Falling back to treating certificate name as a raw Key Vault secret name."
)
# fallback behavior...
else:
# normal behavior...
Example pattern (emit accurate stderr for informational text):
import sys
print("Starting interactive shell session...", file=sys.stderr)