Esempio n. 1
0
def test_get_logger_preserves_logging_module_config():
    assert logging.getLoggerClass() is logging.Logger

    path = "testing.{0}".format(uuid.uuid4())
    logger = get_logger(path, CustomLogger)
    assert isinstance(logger, CustomLogger)

    assert logging.getLoggerClass() is logging.Logger
Esempio n. 2
0
def test_get_extended_debug_logger_if_other_logger_in_cache():
    path = "testing.{0}".format(uuid.uuid4())
    normal_logger = get_logger(path)
    assert not isinstance(normal_logger, ExtendedDebugLogger)
    assert normal_logger.name == path

    extended_logger = get_extended_debug_logger(path)
    assert isinstance(extended_logger, ExtendedDebugLogger)
    assert extended_logger.name == path
Esempio n. 3
0
def test_get_logger_with_CustomLogger():
    path = "testing.{0}".format(uuid.uuid4())
    logger = get_logger(path, CustomLogger)
    assert isinstance(logger, CustomLogger)
    assert logger.name == path
Esempio n. 4
0
def test_get_logger_with_default_class():
    path = "testing.{0}".format(uuid.uuid4())
    logger = get_logger(path, logging.Logger)
    assert isinstance(logger, logging.Logger)
    assert logger.name == path