replace non-Eliot logging with Eliot logging #2343

Open
opened 2014-11-28 22:54:54 +00:00 by daira · 1 comment
daira commented 2014-11-28 22:54:54 +00:00
Owner

We should never be logging directly to the Foolscap or Twisted logs, because that is confusing and misleading, especially when log.err is used (e.g. see #812). We should be logging via Eliot instead.

$ grep -Rn --include='*.py' 'from twisted.python import .*log' src
src/allmydata/node.py:4:from twisted.python import log as twlog
src/allmydata/windows/tahoesvc.py:152:            from twisted.python import log, logfile
src/allmydata/util/iputil.py:10:from twisted.python import log
src/allmydata/util/fileutil.py:7:from twisted.python import log
src/allmydata/util/pipeline.py:4:from twisted.python import log
src/allmydata/util/log.py:4:from twisted.python import log as tw_log
src/allmydata/manhole.py:6:from twisted.python import log
src/allmydata/blacklist.py:6:from twisted.python import log as twisted_log
src/allmydata/web/common.py:4:from twisted.python import log
src/allmydata/storage/expirer.py:6:from twisted.python import log as twlog
src/allmydata/test/test_util.py:9:from twisted.python import log
src/allmydata/test/test_web.py:10:from twisted.python import failure, log
src/allmydata/test/test_introducer.py:8:from twisted.python import log
src/allmydata/test/check_memory.py:13:from twisted.python import log
src/allmydata/test/test_codec.py:4:from twisted.python import log
src/allmydata/test/check_speed.py:3:from twisted.python import log
src/allmydata/test/test_node.py:5:from twisted.python import log
src/allmydata/control.py:12:from twisted.python import log
$ grep -Rn --include='*.py' 'twisted.python.log' src
src/allmydata/test/test_client.py:56:    @mock.patch('twisted.python.log.msg')
We should never be logging directly to the Foolscap or Twisted logs, because that is confusing and misleading, especially when `log.err` is used (e.g. see #812). We should be logging via Eliot instead. ``` $ grep -Rn --include='*.py' 'from twisted.python import .*log' src src/allmydata/node.py:4:from twisted.python import log as twlog src/allmydata/windows/tahoesvc.py:152: from twisted.python import log, logfile src/allmydata/util/iputil.py:10:from twisted.python import log src/allmydata/util/fileutil.py:7:from twisted.python import log src/allmydata/util/pipeline.py:4:from twisted.python import log src/allmydata/util/log.py:4:from twisted.python import log as tw_log src/allmydata/manhole.py:6:from twisted.python import log src/allmydata/blacklist.py:6:from twisted.python import log as twisted_log src/allmydata/web/common.py:4:from twisted.python import log src/allmydata/storage/expirer.py:6:from twisted.python import log as twlog src/allmydata/test/test_util.py:9:from twisted.python import log src/allmydata/test/test_web.py:10:from twisted.python import failure, log src/allmydata/test/test_introducer.py:8:from twisted.python import log src/allmydata/test/check_memory.py:13:from twisted.python import log src/allmydata/test/test_codec.py:4:from twisted.python import log src/allmydata/test/check_speed.py:3:from twisted.python import log src/allmydata/test/test_node.py:5:from twisted.python import log src/allmydata/control.py:12:from twisted.python import log $ grep -Rn --include='*.py' 'twisted.python.log' src src/allmydata/test/test_client.py:56: @mock.patch('twisted.python.log.msg') ```
tahoe-lafs added the
code
normal
defect
1.10.0
labels 2014-11-28 22:54:54 +00:00
tahoe-lafs added this to the undecided milestone 2014-11-28 22:54:54 +00:00

I think the first half of this is true but the second half should refer to Eliot, instead. Adjusting ticket accordingly.

I think the first half of this is true but the second half should refer to Eliot, instead. Adjusting ticket accordingly.
exarkun changed title from remove all direct logging to twisted.python.log/err to replace non-Eliot logging with Eliot logging 2020-01-17 15:45:06 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#2343
No description provided.