Edgewall Software
Modify

Opened 3 years ago

Closed 23 months ago

Last modified 20 months 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@…
Release Notes:
API Changes:

Removed obsolete trac.log.logger_factory function.

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 follow-up: Changed 3 years ago by rblank

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

comment:2 Changed 3 years ago by rblank

  • Milestone changed from 0.12.3 to 0.13
  • Type changed from defect to enhancement

(And enhancements go to 0.13.)

comment:3 in reply to: ↑ 1 ; follow-up: Changed 3 years ago by cboos

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

comment:4 in reply to: ↑ 3 Changed 3 years ago by anatoly techtonik <techtonik@…>

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 Changed 3 years ago by osimons

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 3 years ago by osimons (previous) (diff)

comment:6 Changed 3 years ago by cboos

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 Changed 2 years ago by osimons

  • 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 Changed 23 months ago by rblank

  • Owner set to rblank

comment:9 Changed 23 months ago by rblank

  • Resolution set to fixed
  • Status changed from new to closed

Nuked in [11061].

comment:10 Changed 23 months ago by rblank

  • Owner changed from rblank to anatoly techtonik <techtonik@…>

comment:11 Changed 22 months ago by Ryan J Ollos <ryano@…>

  • Cc ryano@… added

comment:12 Changed 20 months ago by cboos

  • API Changes modified (diff)
  • Severity changed from normal to minor

Add Comment

Modify Ticket

Change Properties
<Author field>
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.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.