Skip to content

Commit d1137b4

Browse files
committed
Use error log over print to avoid stdout write
1 parent c97b3a0 commit d1137b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

google/api_core/_python_version_support.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@
1616

1717
import datetime
1818
import enum
19+
import logging
1920
import warnings
2021
import sys
2122
import textwrap
2223
from typing import Any, List, NamedTuple, Optional, Dict, Tuple
2324

2425

26+
_LOGGER = logging.getLogger(__name__)
27+
28+
2529
class PythonVersionStatus(enum.Enum):
2630
"""Support status of a Python version in this client library artifact release.
2731
@@ -171,7 +175,7 @@ def _get_pypi_package_name(module_name):
171175
else:
172176
return None # Module not found in the mapping
173177
except Exception as e:
174-
print(f"An error occurred: {e}")
178+
_LOGGER.error("An error occurred: %s", e)
175179
return None
176180

177181

0 commit comments

Comments
 (0)