[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2343: replace non-Eliot logging with Eliot logging (was: remove all direct logging to twisted.python.log/err)
Tahoe-LAFS
trac at tahoe-lafs.org
Fri Jan 17 15:45:06 UTC 2020
#2343: replace non-Eliot logging with Eliot logging
------------------------+-----------------------------------
Reporter: daira | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: code | Version: 1.10.0
Resolution: | Keywords: error logging twisted
Launchpad Bug: |
------------------------+-----------------------------------
Old description:
> We should never be logging directly to the Twisted log, because that is
> confusing and misleading, especially when `log.err` is used (e.g. see
> #812). We should be logging via `allmydata.util.log.msg` 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')
> }}}
New description:
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')
}}}
--
Comment (by exarkun):
I think the first half of this is true but the second half should refer to
Eliot, instead. Adjusting ticket accordingly.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2343#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list