Edgewall Software
Modify

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#10427 closed enhancement (fixed)

trac.log: dead code - logger_factory()

Reported by: anatoly techtonik <techtonik@…> Owned by: anatoly techtonik <techtonik@…>
Priority: normal Milestone: 1.0
Component: general Version:
Severity: minor Keywords:
Cc: osimons, ryano@… Branch:
Release Notes:
API Changes:

Removed obsolete trac.log.logger_factory function.

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)

comment:1 by Remy Blank, 13 years ago

Right about now Simon should jump out of nowhere and claim that ~800 plugins rely on that function ;)

comment:2 by Remy Blank, 13 years ago

Milestone: 0.12.30.13
Type: defectenhancement

(And enhancements go to 0.13.)

in reply to:  1 ; comment:3 by Christian Boos, 13 years ago

Replying to rblank:

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).

in reply to:  3 comment:4 by anatoly techtonik <techtonik@…>, 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 osimons, 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… ;-)

Last edited 13 years ago by osimons (previous) (diff)

comment:6 by Christian Boos, 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 osimons, 13 years ago

Cc: osimons 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 Remy Blank, 12 years ago

Owner: set to Remy Blank

comment:9 by Remy Blank, 12 years ago

Resolution: fixed
Status: newclosed

Nuked in [11061].

comment:10 by Remy Blank, 12 years ago

Owner: changed from Remy Blank to anatoly techtonik <techtonik@…>

comment:11 by Ryan J Ollos <ryano@…>, 12 years ago

Cc: ryano@… added

comment:12 by Christian Boos, 12 years ago

API Changes: modified (diff)
Severity: normalminor

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anatoly techtonik <techtonik@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from anatoly techtonik <techtonik@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.