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 /arper.py | |
| parent | d2478310649d51e14f8ece57651ca9d925d98793 (diff) | |
Start using warnings from stdlib.
Diffstat (limited to 'arper.py')
| -rw-r--r-- | arper.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -6,6 +6,7 @@ import datetime import logging import os from typing import Any, Optional +import warnings from overrides import overrides @@ -126,9 +127,9 @@ class Arper(persistent.Persistent): if len(cached_state) > config.config['arper_min_entries_to_be_valid']: return cls(cached_state) else: - logger.warning( - f'{cache_file} sucks, only {len(cached_state)} entries. Deleting it.' - ) + msg = f'{cache_file} is invalid: only {len(cached_state)} entries. Deleting it.' + warnings.warn(msg) + logger.warning(msg) os.remove(cache_file) logger.debug('No usable saved state found') return None |
