How to use the av.logging function in av

To help you get started, we’ve selected a few av examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikeboers / PyAV / tests / test_logging.py View on Github external
def test_adapt_level(self):
        self.assertEqual(
            av.logging.adapt_level(av.logging.ERROR),
            logging.ERROR
        )
        self.assertEqual(
            av.logging.adapt_level(av.logging.WARNING),
            logging.WARNING
        )
        self.assertEqual(
            av.logging.adapt_level((av.logging.WARNING + av.logging.ERROR) // 2),
            logging.WARNING
        )
github mikeboers / PyAV / tests / test_logging.py View on Github external
def test_adapt_level(self):
        self.assertEqual(
            av.logging.adapt_level(av.logging.ERROR),
            logging.ERROR
        )
        self.assertEqual(
            av.logging.adapt_level(av.logging.WARNING),
            logging.WARNING
        )
        self.assertEqual(
            av.logging.adapt_level((av.logging.WARNING + av.logging.ERROR) // 2),
            logging.WARNING
        )
github mikeboers / PyAV / tests / test_logging.py View on Github external
def test_repeats(self):

        with av.logging.Capture() as logs:
            do_log('foo')
            do_log('foo')
            do_log('bar')
            do_log('bar')
            do_log('bar')
            do_log('baz')

        logs = [l for l in logs if l[1] == 'test']

        self.assertEqual(logs, [
            (av.logging.INFO, 'test', 'foo'),
            (av.logging.INFO, 'test', 'foo'),
            (av.logging.INFO, 'test', 'bar'),
            (av.logging.INFO, 'test', 'bar (repeated 2 more times)'),
            (av.logging.INFO, 'test', 'baz'),
github mikeboers / PyAV / tests / test_logging.py View on Github external
def do_log(message):
    av.logging.log(av.logging.INFO, 'test', message)