projects
/
pyutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9b5c9b9
)
Remove tprint, add docs.
author
Scott Gasch
<
[email protected]
>
Fri, 3 Mar 2023 20:08:21 +0000
(12:08 -0800)
committer
Scott Gasch
<
[email protected]
>
Fri, 3 Mar 2023 20:08:21 +0000
(12:08 -0800)
src/pyutils/logging_utils.py
patch
|
blob
|
history
diff --git
a/src/pyutils/logging_utils.py
b/src/pyutils/logging_utils.py
index d9ebadc609e78de4b9cf8310a3a6e2e9ad9b1e10..669ba21499f2653f3e8c4be2cc86505e7169582a 100644
(file)
--- 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):
"""
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
super().__init__()
if prefix:
self.prefix = prefix
@@
-396,6
+401,11
@@
class SuffixAddingFilter(logging.Filter):
"""
def __init__(self, suffix: str, klobber: bool = False):
"""
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
super().__init__()
if suffix:
self.suffix = suffix
@@
-986,20
+996,6
@@
def get_logger(name: str = ""):
return initialize_logging(logger)
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
class OutputMultiplexer(object):
"""A class that broadcasts printed messages to several sinks
(including various logging levels, different files, different file