# Path: seedbox/service.py
# PROJECT = __package__
# DEFAULT_LIBRARY_LOG_LEVEL = {'xworkflows': logging.ERROR,
#                              'stevedore': logging.ERROR,
#                              'sqlalchemy': logging.ERROR,
#                              'migrate': logging.ERROR,
#                              }
# CONSOLE_MESSAGE_FORMAT = '%(message)s'
# LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
# def _setup_logging():
# def _configure(args):
# def prepare_service(args=None):
# 
# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):


import logging
import logging.handlers
import os
import shutil
import tempfile
import fixtures
from oslo_config import cfg
from testtools import matchers
from seedbox import service
from seedbox.tests import test
    def test_setup_logging(self):
        del logging.getLogger().handlers[:]
        service._setup_logging()
        self.assertEqual(logging.getLogger().getEffectiveLevel(),
                         logging.INFO)
        self.assertEqual(logging.getLogger('sqlalchemy').getEffectiveLevel(),
                         logging.ERROR)

        for hndler in logging.getLogger().handlers:
            self.assertThat(
                hndler,
                matchers.MatchesAny(
                    matchers.IsInstance(logging.handlers.RotatingFileHandler),
                    matchers.IsInstance(logging.StreamHandler),
                    matchers.IsInstance(logging.NullHandler)))

    def test_setup_logging_no_logfile(self):
        self.CONF.set_override('logfile', None)
        del logging.getLogger().handlers[:]
        service._setup_logging()
        for hndler in logging.getLogger().handlers:
            self.assertThat(
                hndler,
                matchers.MatchesAny(
                    matchers.IsInstance(logging.StreamHandler),
                    matchers.IsInstance(logging.NullHandler)))

    def test_setup_logging_cron(self):
        self.CONF.set_override('cron', True)
        del logging.getLogger().handlers[:]

# Path: seedbox/service.py
# PROJECT = __package__
# DEFAULT_LIBRARY_LOG_LEVEL = {'xworkflows': logging.ERROR,
#                              'stevedore': logging.ERROR,
#                              'sqlalchemy': logging.ERROR,
#                              'migrate': logging.ERROR,
#                              }
# CONSOLE_MESSAGE_FORMAT = '%(message)s'
# LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
# def _setup_logging():
# def _configure(args):
# def prepare_service(args=None):
# 
# Path: seedbox/tests/test.py
# class ConfiguredBaseTestCase(BaseTestCase):
#     def setUp(self):
#     def tearDown(self):
#     def _make_dir(self, dirname):
#     def set_required_options(self):


# Path: seedbox/tests/test_service.py
import logging
import logging.handlers
import os
import shutil
import tempfile
import fixtures
from oslo_config import cfg
from testtools import matchers
from seedbox import service
from seedbox.tests import test

    def test_setup_logging(self):
        del logging.getLogger().handlers[:]
        service._setup_logging()
        self.assertEqual(logging.getLogger().getEffectiveLevel(),
                         logging.INFO)
        self.assertEqual(logging.getLogger('sqlalchemy').getEffectiveLevel(),
                         logging.ERROR)

        for hndler in logging.getLogger().handlers:
            self.assertThat(
                hndler,
                matchers.MatchesAny(
                    matchers.IsInstance(logging.handlers.RotatingFileHandler),
                    matchers.IsInstance(logging.StreamHandler),
                    matchers.IsInstance(logging.NullHandler)))

    def test_setup_logging_no_logfile(self):
        self.CONF.set_override('logfile', None)
        del logging.getLogger().handlers[:]
        service._setup_logging()
        for hndler in logging.getLogger().handlers:
            self.assertThat(
                hndler,
                matchers.MatchesAny(
                    matchers.IsInstance(logging.StreamHandler),
                    matchers.IsInstance(logging.NullHandler)))

    def test_setup_logging_cron(self):
        self.CONF.set_override('cron', True)
        del logging.getLogger().handlers[:]

        service._setup_logging()