diff options
| author | Scott <[email protected]> | 2022-01-11 13:33:24 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-01-11 13:33:24 -0800 |
| commit | b454ad295eb3024a238d32bf2aef1ebc3c496b44 (patch) | |
| tree | 89368a7cdad571da9e2c7297190fdce48eb3feb9 /persistent.py | |
| parent | d2478310649d51e14f8ece57651ca9d925d98793 (diff) | |
Start using warnings from stdlib.
Diffstat (limited to 'persistent.py')
| -rw-r--r-- | persistent.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/persistent.py b/persistent.py index f6ca0a0..2751572 100644 --- a/persistent.py +++ b/persistent.py @@ -7,6 +7,7 @@ import enum import functools import logging from typing import Any +import warnings import file_utils @@ -143,7 +144,9 @@ class persistent_autoloaded_singleton(object): logger.debug(f'Attempting to load {cls.__name__} from persisted state.') self.instance = cls.load() if not self.instance: - logger.warning('Loading from cache failed.') + msg = 'Loading from cache failed.' + logger.warning(msg) + warnings.warn(msg) logger.debug(f'Attempting to instantiate {cls.__name__} directly.') self.instance = cls(*args, **kwargs) else: |
