Skip to content

Commit e7d8975

Browse files
committed
Adding the logging inside the null obj constructor
1 parent 639e371 commit e7d8975

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

nodestream/pipeline/object_storage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import base64
22
import hashlib
33
import hmac
4+
import logging
45
import pickle
56
from abc import ABC, abstractmethod
67
from dataclasses import dataclass
@@ -13,6 +14,9 @@
1314
from ..subclass_registry import SubclassRegistry
1415
from .extractors.credential_utils import AwsClientFactory
1516

17+
logger = logging.getLogger(__name__)
18+
19+
1620
OBJECT_STORE_REGISTRY = SubclassRegistry(ignore_overrides=True)
1721
T = TypeVar("T")
1822

@@ -248,6 +252,9 @@ def delete(self, key: str):
248252
class NullObjectStore(ObjectStore, alias="null"):
249253
"""An object store that does not store any objects."""
250254

255+
def __init__(self):
256+
logger.error("Using null ObjectStore. No persistence is configured.")
257+
251258
def get(self, _: str) -> Optional[bytes]:
252259
return None
253260

nodestream/project/storage.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import logging
21
from dataclasses import dataclass, field
32
from typing import Any, Dict, Optional, Union
43

@@ -61,8 +60,6 @@ class StorageConfiguration:
6160

6261
def initialize_by_name(self, name: str) -> ObjectStore:
6362
if name not in self.storage_configuration_by_name:
64-
logger = logging.getLogger(__name__)
65-
logger.info(f"Store configuration '{name}' not found.")
6663
return ObjectStore.null()
6764

6865
return self.storage_configuration_by_name[name].initialize()

0 commit comments

Comments
 (0)