diff options
| author | robot-piglet <[email protected]> | 2024-04-09 10:52:27 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-04-09 11:00:19 +0300 |
| commit | d3a5d09ba52276f88b44a096dedc83f0a18d041d (patch) | |
| tree | a70c18f9ae0df645b9aa729479c4de8baddddab4 /yt/python | |
| parent | a8b456d0e029cb11e445e66fb0dc7b609a546659 (diff) | |
Intermediate changes
Diffstat (limited to 'yt/python')
| -rw-r--r-- | yt/python/yt/logger.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/yt/python/yt/logger.py b/yt/python/yt/logger.py index d2007eaca39..d3d5c933aba 100644 --- a/yt/python/yt/logger.py +++ b/yt/python/yt/logger.py @@ -114,5 +114,15 @@ def exception(msg, *args, **kwargs): LOGGER.exception(msg, *args, **kwargs) +if hasattr(functools, 'lru_cache') and not os.environ.get("YT_LOG_NO_TIP"): + @functools.lru_cache(maxsize=128) + def tip(msg): + LOGGER.debug("[TIP] " + msg) +else: + # py2 + def tip(msg): + pass + + def log(level, msg, *args, **kwargs): LOGGER.log(level, msg, *args, **kwargs) |
