mirror of
https://github.com/codex-storage/deluge.git
synced 2025-03-03 04:20:40 +00:00
Passing `-r` to the cli's while also passing `-l` will make the logfile rotate when reaching 5Mb in size. Three backups will be kept at all times. All deluge's code is now using this new style logging along with the git hosted plugins. For other plugins not hosted by deluge, which still imports `LOG` as the logger, a deprecation warning will be shown explaining the required changes needed to use the new style logging. New plugins created by the `create_plugin` script will use the new logging facilities.
22 lines
648 B
Python
22 lines
648 B
Python
import logging
|
|
from twisted.internet import defer
|
|
from twisted.trial import unittest
|
|
from deluge.log import setupLogger
|
|
|
|
class LogTestCase(unittest.TestCase):
|
|
def setUp(self):
|
|
setupLogger(logging.DEBUG)
|
|
|
|
def tearDown(self):
|
|
pass
|
|
|
|
def test_old_LOG_deprecation_warning(self):
|
|
import warnings
|
|
from deluge.log import LOG
|
|
warnings.filterwarnings("ignore", category=DeprecationWarning,
|
|
module="deluge.tests.test_log")
|
|
d = defer.Deferred()
|
|
d.addCallback(LOG.debug, "foo")
|
|
self.assertFailure(d, DeprecationWarning)
|
|
warnings.resetwarnings()
|