From: Scott Gasch Date: Fri, 3 Mar 2023 20:08:21 +0000 (-0800) Subject: Remove tprint, add docs. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=192d0d0380353a0943b1794368ade6671082d45d;p=pyutils.git Remove tprint, add docs. --- diff --git a/src/pyutils/logging_utils.py b/src/pyutils/logging_utils.py index d9ebadc..669ba21 100644 --- a/src/pyutils/logging_utils.py +++ b/src/pyutils/logging_utils.py @@ -373,6 +373,11 @@ class PrefixAddingFilter(logging.Filter): """ def __init__(self, prefix: str, klobber: bool = False): + """ + Args: + prefix: the prefix string to add + klobber: should we overwrite other prefixes? + """ super().__init__() if prefix: self.prefix = prefix @@ -396,6 +401,11 @@ class SuffixAddingFilter(logging.Filter): """ def __init__(self, suffix: str, klobber: bool = False): + """ + Args: + suffix: the suffix string to add + klobber: should we overwrite other suffixes? + """ super().__init__() if suffix: self.suffix = suffix @@ -986,20 +996,6 @@ def get_logger(name: str = ""): return initialize_logging(logger) -def tprint(*args, **kwargs) -> None: - """Legacy function for printing a message augmented with thread id - still needed by some code. Please use --logging_debug_threads in - new code. - """ - if config.config["logging_debug_threads"]: - from pyutils.parallelize.thread_utils import current_thread_id - - print(f"{current_thread_id()}", end="") - print(*args, **kwargs) - else: - pass - - class OutputMultiplexer(object): """A class that broadcasts printed messages to several sinks (including various logging levels, different files, different file