Skip to content

Commit f97b27c

Browse files
committed
loggingstore inherits from wrapperstore
1 parent c486351 commit f97b27c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/zarr/storage/logging.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
from typing import TYPE_CHECKING, Any, Self
99

1010
from zarr.abc.store import AccessMode, ByteRangeRequest, Store
11+
from zarr.storage.wrapper import WrapperStore
1112

1213
if TYPE_CHECKING:
1314
from collections.abc import AsyncGenerator, Generator, Iterable
1415

1516
from zarr.core.buffer import Buffer, BufferPrototype
1617
from zarr.core.common import AccessModeLiteral
1718

19+
counter: defaultdict[str, int]
20+
1821

19-
class LoggingStore(Store):
22+
class LoggingStore(WrapperStore[Store]):
2023
"""
2124
Store wrapper that logs all calls to the wrapped store.
2225
@@ -35,7 +38,6 @@ class LoggingStore(Store):
3538
Counter of number of times each method has been called
3639
"""
3740

38-
_store: Store
3941
counter: defaultdict[str, int]
4042

4143
def __init__(
@@ -44,11 +46,10 @@ def __init__(
4446
log_level: str = "DEBUG",
4547
log_handler: logging.Handler | None = None,
4648
) -> None:
47-
self._store = store
49+
super().__init__(store)
4850
self.counter = defaultdict(int)
4951
self.log_level = log_level
5052
self.log_handler = log_handler
51-
5253
self._configure_logger(log_level, log_handler)
5354

5455
def _configure_logger(

0 commit comments

Comments
 (0)