Skip to content

Commit 42425a4

Browse files
committed
apply suggestions from code review
1 parent 1daa944 commit 42425a4

File tree

4 files changed

+4
-27
lines changed

4 files changed

+4
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### 0.13.6 -- TBD
44
* Add - unified package level logger for package (#667) PR #1031
5-
* Update - swap various datajoint messages, warnings, etc. to use the new logger.( #667) PR #1031
5+
* Update - swap various datajoint messages, warnings, etc. to use the new logger. (#667) PR #1031
66

77
### 0.13.5 -- May 19, 2022
88
* Update - Import ABC from collections.abc for Python 3.10 compatibility

datajoint/diagram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from .errors import DataJointError
1111
from .table import lookup_class_name
1212

13-
logger = logging.getLogger(__name__.split(".")[0])
1413

1514
try:
1615
from matplotlib import pyplot as plt
@@ -27,6 +26,7 @@
2726
diagram_active = False
2827

2928

29+
logger = logging.getLogger(__name__.split(".")[0])
3030
user_table_classes = (Manual, Lookup, Computed, Imported, Part)
3131

3232

datajoint/logging.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
logger = logging.getLogger(__name__.split(".")[0])
77

8-
log_level = os.environ.get("DJ_LOG_LEVEL", "warning").upper()
8+
log_level = os.getenv("DJ_LOG_LEVEL", "info").upper()
99

1010
log_format = logging.Formatter(
1111
"[%(asctime)s][%(funcName)s][%(levelname)s]: %(message)s"
@@ -32,26 +32,3 @@ def excepthook(exc_type, exc_value, exc_traceback):
3232

3333

3434
sys.excepthook = excepthook
35-
36-
37-
# https://github.com/tqdm/tqdm/issues/313#issuecomment-267959111
38-
class TqdmToLogger(io.StringIO):
39-
"""
40-
Output stream for TQDM which will output to logger module instead of
41-
the StdOut.
42-
"""
43-
44-
logger = None
45-
level = None
46-
buf = ""
47-
48-
def __init__(self, logger, level=None):
49-
super(TqdmToLogger, self).__init__()
50-
self.logger = logger
51-
self.level = level or logging.INFO
52-
53-
def write(self, buf):
54-
self.buf = buf.strip("\r\n\t ")
55-
56-
def flush(self):
57-
self.logger.log(self.level, self.buf)

docs-parts/intro/Releases_lang1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
0.13.6 -- TBD
22
----------------------
33
* Add - unified package level logger for package (#667) PR #1031
4-
* Update - swap various datajoint messages, warnings, etc. to use the new logger.( #667) PR #1031
4+
* Update - swap various datajoint messages, warnings, etc. to use the new logger. (#667) PR #1031
55

66
0.13.5 -- May 19, 2022
77
----------------------

0 commit comments

Comments
 (0)