eventdebug and eventfilter=TYPE options don't work

Bug #878410 reported by Rocco Aliberti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Mathias Brodala

Bug Description

That's 'cause, in xl/main.py the method "setup_logging()", where the debug option is managed, is called before the management of the options in subject, and then the "options.Debug" has not been properly set.

Related branches

Revision history for this message
Mathias Brodala (mathbr) wrote :

The issue was that --eventdebug did not imply --debug, thus you could not see the (possibly filtered) event debug messages.
This has been resolved with r3895.

Changed in exaile:
assignee: nobody → Mathias Brodala (mathbr)
importance: Undecided → Low
milestone: none → 0.3.3.0
status: New → Fix Committed
Revision history for this message
Rocco Aliberti (eri.trabiccolo) wrote :

That's what i wanted to say, looking at this piece of code of xl/main.py :

        self.setup_logging()
        global logger
        logger = logging.getLogger(__name__)

        # Late import ensures xl.event uses correct logger
        from xl import event

        if self.options.EventFilter:
            event.EVENT_MANAGER.logger_filter = self.options.EventFilter
            self.options.DebugEvent = True

        if self.options.DebugEvent:
            event.EVENT_MANAGER.use_logger = True
            self.options.Debug = True

I thought would already implicate it, and that the problem was due to an oversight.

In any case, the eventfilter option, of course, still does not work.

Revision history for this message
Mathias Brodala (mathbr) wrote :

Works fine:

$ ./exaile --eventdebug --eventfilter=gui_loaded 2>&1 | grep Sent
23:58:40,268:DEBUG : Sent 'gui_loaded' event from '<xl.main.Exaile object at 0x7f500ee59dd0>' with data 'None'. (xl.event)

$ ./exaile --eventdebug --eventfilter=exaile_loaded 2>&1 | grep Sent
23:58:52,967:DEBUG : Sent 'exaile_loaded' event from '<xl.main.Exaile object at 0x7f0d649f3dd0>' with data 'None'. (xl.event)

(Added the "2>&1 | grep Sent" part to ignore all other debug output.)

Revision history for this message
Rocco Aliberti (eri.trabiccolo) wrote :

Well, reading the help and that part of code, which seemed to show how eventfilter implied eventdebug, I thought that was enough:
exaile --eventfilter=TYPE

But if it should work as you say (and I don't doubt), my fault. ;)
Thank you.

Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.