Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#621 closed feature-request (Fixed)

Disabling Logging

Reported by: m_buck@hotmail.com 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 by mvoncken, 16 years ago

Resolution: fixed
Status: newclosed

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 by mvoncken, 16 years ago

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 by m_buck@hotmail.com, 16 years ago

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.