#10427 closed enhancement (fixed)
trac.log: dead code - logger_factory()
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | general | Version: | |
Severity: | minor | Keywords: | |
Cc: | osimons, ryano@… | Branch: | |
Release Notes: | |||
API Changes: |
Removed obsolete |
||
Internal Changes: |
Description
This code is not referenced from anywhere. It is dead and can be removed - source:/branches/0.12-stable/trac/log.py@10847:67-70#L64
Attachments (0)
Change History (12)
follow-up: 3 comment:1 by , 13 years ago
comment:2 by , 13 years ago
Milestone: | 0.12.3 → 0.13 |
---|---|
Type: | defect → enhancement |
(And enhancements go to 0.13.)
follow-up: 4 comment:3 by , 13 years ago
comment:4 by , 13 years ago
Right about now Simon should jump out of nowhere and claim that ~800 plugins rely on that function ;)
He he ;-)
But that was the plan, so it's fine (#9918).
Is there objective stats on those ~800 plugins? Online grep interface? =)
comment:5 by , 13 years ago
BTW, I'm not making that number up…
$> svn ls http://trac-hacks.org/svn/ | wc -l 782
And I know plenty of other plugins (including some of mine) that are not published on Trac-Hacks.
Anyway, it was all just meant as a pointer to the fact that there is a lot of legacy code out there that depend on Trac internals… The dead code is likely a left-over of some deprecated call-behaviour, and I cannot see that any of those plugins will still be working with recent Trac versions anyway - not with the current eagerness to break APIs and move things around to suit Trac internals… ;-)
comment:6 by , 13 years ago
I wonder if we couldn't add a trac/compat.py
module where we could easily move all the old code… something like:
from trac import log def logger_factory(logtype='syslog', logfile=None, level='WARNING', logid='Trac', format=None): return log.logger_handler_factory(logtype, logfile, level, logid, format)[0] log.logger_factory = logger_factory
That way, people could get a cheap way to keep their plugin working, and it would also serve as a way to document what has changed for those who want to adapt their code. That would help to keep the rest of the codebase clean, yet give a safety net for plugins. Of course, this will only work to compensate for removed functions or methods, not for signature changes, but that would still be something.
comment:7 by , 13 years ago
Cc: | added |
---|
We already have trac.util.compat
, but in this case it makes more sense just to remove the code. There is no actual behavior change or code removal, it is just another way calling the same code. If you need to update to import from other module, it should not require much more effort just to change your call syntax instead.
+1 for removing in trunk, no compat.
comment:8 by , 12 years ago
Owner: | set to |
---|
comment:10 by , 12 years ago
Owner: | changed from | to
---|
comment:11 by , 12 years ago
Cc: | added |
---|
comment:12 by , 12 years ago
API Changes: | modified (diff) |
---|---|
Severity: | normal → minor |
Right about now Simon should jump out of nowhere and claim that ~800 plugins rely on that function ;)