Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#621 closed feature-request (Fixed)

Disabling Logging

Reported by: m_buck@… Owned by: mvoncken
Priority: minor Milestone:
Component: Core Version: 1.0.5
Keywords: logging disable only deluge Cc:

Description

Hi Mvoncken,

I have a python script which I am using to attach to the sclient and all is working fine.

I currently have the logging turned off using:

import logging logging.disable(logging.FATAL)

However, I now want to implement my own logging in the script and need to only turn off the deluge logging...how do I do this?

I have attempted to do it using either of the below, with no affect:

1) from deluge.log import logging as delugelogging delugelogging.disable(logging.FATAL)

2) from deluge import log log.LOG.disabled = True

Is there any way I can manipulate logging options just for deluge? Will this require some deluge code development? Is it even possible?

Any help will be much appreciated

Thanks, Mark (Kaivalagi)

Change History (3)

comment:1 Changed 15 years ago by mvoncken

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

from deluge.log import LOG as log import logging

custom_logger = logging.getLogger("test") custom_logger.setLevel(logging.DEBUG)

log.setLevel(logging.DEBUG) log.debug("deluge log") custom_logger.debug("custom log")

log.setLevel(logging.INFO) log.debug("deluge log(not displayed)") custom_logger.debug("custom log")

comment:2 Changed 15 years ago by mvoncken

from deluge.log import LOG as log
import logging

custom_logger = logging.getLogger("test")
custom_logger.setLevel(logging.DEBUG)

log.setLevel(logging.DEBUG)
log.debug("deluge log")
custom_logger.debug("custom log")

log.setLevel(logging.INFO)
log.debug("deluge log(not displayed)")
custom_logger.debug("custom log")

comment:3 Changed 15 years ago by m_buck@…

Thanks, that worked perfectly, as expected :)

I now have python logging in all my apps, even the deluge one with deluge logging turned off

Can I suggest that you update the wiki on this too

Thanks for your help

Note: See TracTickets for help on using tickets.