package org.apache.logging.log4j.core.config.yaml;

import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.json.JsonConfiguration;

public class YamlConfiguration extends JsonConfiguration {
   public YamlConfiguration(ConfigurationSource configSource) {
      super(configSource);
   }

   protected ObjectMapper getObjectMapper() {
      return (new ObjectMapper(new YAMLFactory())).configure(Feature.ALLOW_COMMENTS, true);
   }
}
