Skip to content

Commit 8a04f02

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
sambacc: add logging to rados opener
Add some debug level logging to the rados opener. Signed-off-by: John Mulligan <[email protected]>
1 parent b8e6e76 commit 8a04f02

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sambacc/rados_opener.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import io
2222
import json
23+
import logging
2324
import typing
2425
import urllib.request
2526

@@ -31,6 +32,8 @@
3132

3233
_CHUNK_SIZE = 4 * 1024
3334

35+
_logger = logging.getLogger(__name__)
36+
3437

3538
class RADOSUnsupported(Exception):
3639
pass
@@ -47,6 +50,7 @@ def Rados(self) -> _RADOSObject:
4750
name = self.client_name
4851
else:
4952
rados_id = self.client_name
53+
_logger.debug("Creating RADOS connection")
5054
return self.api.Rados(
5155
name=name,
5256
rados_id=rados_id,
@@ -232,8 +236,13 @@ def enable_rados_url_opener(
232236
try:
233237
import rados # type: ignore[import]
234238
except ImportError:
239+
_logger.debug("Failed to import ceph 'rados' module")
235240
return
236241

242+
_logger.debug(
243+
"Enabling ceph rados support with"
244+
f" client_name={client_name!r}, full_name={full_name}"
245+
)
237246
rados_interface = _RADOSInterface()
238247
rados_interface.api = rados
239248
rados_interface.client_name = client_name

0 commit comments

Comments
 (0)