@Override
    public LoggingConfig extract(ConfigValue<?> value) {
        if (value instanceof ConfigValue.NullValue) {
            return new LoggingConfig(Map.of("ROOT", "info"));
        }
        if (!(value instanceof ObjectValue objectValue)) {
            throw ConfigValueExtractionException.unexpectedValueType(value, ObjectValue.class);
        }

        var levels = new LinkedHashMap<String, String>();

        var levelsObject = objectValue.get("levels");
        if (levelsObject instanceof ConfigValue.NullValue) {
            levelsObject = objectValue.get("level");
        }

        if (levelsObject instanceof ConfigValue.NullValue) {
            return new LoggingConfig(levels);
        }
        if (levelsObject instanceof ObjectValue l) {
            for (var entry : l) {
                collectLevels("", entry.getKey(), entry.getValue(), levels);
            }
            return new LoggingConfig(levels);
        } else {
            throw ConfigValueExtractionException.unexpectedValueType(value, ObjectValue.class);
        }
    }
@Test
    void testParseConfig() {
        var config = MapConfigFactory.fromMap(Map.of(
            "logging", Map.of(
                "level", Map.of(
                    "root", "info",
                    "ru.tinkoff.package1", "debug",
                    "ru.tinkoff.package2", "trace",
                    "ru.tinkoff.package3", "warn",
                    "ru.tinkoff.package4", "error",
                    "ru.tinkoff.package5", "all"
                ))
        ));

        var extractor = new LoggingConfigValueExtractor();

        var result = extractor.extract(config.get("logging"));


        Assertions.assertThat(result.levels())
            .containsEntry("root", "info")
            .containsEntry("ru.tinkoff.package1", "debug")
            .containsEntry("ru.tinkoff.package2", "trace")
            .containsEntry("ru.tinkoff.package3", "warn")
            .containsEntry("ru.tinkoff.package4", "error")
            .containsEntry("ru.tinkoff.package5", "all")
        ;
    }