From 101a76d2ed39d23b0b447c2cdf82ca3306f465e8 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 4 Mar 2026 13:40:55 +0100 Subject: [PATCH] Deprecate logging helpers in sysmisc Only real user of this feature (QA) is replacing it, so prepare removal and help finding the remaining users. --- src/sysmisc.py | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/sysmisc.py b/src/sysmisc.py index 12c7f82..335aa5d 100644 --- a/src/sysmisc.py +++ b/src/sysmisc.py @@ -71,7 +71,7 @@ The library exports the symbols below and some custom logging functions. A context manager that temporarily changes the current working directory The logging functions either use the format capability or play -the simple role of providing shorter names. +the simple role of providing shorter names (which is now deprecated). """ import re import subprocess @@ -84,6 +84,7 @@ import uuid from contextlib import contextmanager import enum import logging +import warnings llog = logging.getLogger('pyi2ncommon.sysmisc') @@ -469,27 +470,37 @@ def progress(fmt, *args): # these methods serve as shorter names def inf(fmt, *args): """Short name for INFO logging.""" + warnings.warn("Please replace usage of logging helpers in pyi2ncommon.sysmisc.", + DeprecationWarning, stacklevel=2) llog.info(fmt, *args) def dbg(fmt, *args): """Short name for DEBUG logging.""" + warnings.warn("Please replace usage of logging helpers in pyi2ncommon.sysmisc.", + DeprecationWarning, stacklevel=2) llog.debug(fmt, *args) def err(fmt, *args): """Short name for ERROR logging.""" + warnings.warn("Please replace usage of logging helpers in pyi2ncommon.sysmisc.", + DeprecationWarning, stacklevel=2) llog.error(fmt, *args) def wrn(fmt, *args): """Short name for WARN logging.""" + warnings.warn("Please replace usage of logging helpers in pyi2ncommon.sysmisc.", + DeprecationWarning, stacklevel=2) llog.warning(fmt, *args) # these methods use the format capability def log(level, text, *args, **kwargs): """Log at any level using format capability.""" + warnings.warn("Please replace usage of logging helpers in pyi2ncommon.sysmisc.", + DeprecationWarning, stacklevel=3) llog.log(level, text.format(*args), **kwargs) -- 1.7.1