From: Christian Herdtweck Date: Wed, 4 Mar 2026 12:40:55 +0000 (+0100) Subject: Deprecate logging helpers in sysmisc X-Git-Tag: v1.7.5~1 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=101a76d2ed39d23b0b447c2cdf82ca3306f465e8;p=pyi2ncommon Deprecate logging helpers in sysmisc Only real user of this feature (QA) is replacing it, so prepare removal and help finding the remaining users. --- 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)