<commit_before>package com.softwaremill.codebrag.dao

import com.typesafe.config.Config
import scala.Predef._
import com.typesafe.scalalogging.slf4j.Logging

trait DaoConfig extends Logging {
  def rootConfig: Config

  object StorageType extends Enumeration {
    type StorageType = Value
    val Embedded, Mongo = Value
  }
  import StorageType._

  lazy val storageType: StorageType = {
    if (rootConfig.hasPath("storage.type")) {
      rootConfig.getString("storage.type").toLowerCase.trim match {
        case "embedded" => Embedded
        case "mongo" => Mongo
        case x => throw new IllegalStateException(s"Unknown storage type $x")
      }
    } else {
      logger.info("Assuming default storage: mongo")
      Mongo
    }
  }

  lazy val isEmbeddedStorage = storageType == StorageType.Embedded

  lazy val mongoServers: String = rootConfig.getString("mongo.servers")
  lazy val mongoDatabase: String = rootConfig.getString("mongo.database")

  lazy val embeddedDataDir: String = rootConfig.getString("storage.embedded.datadir")
  lazy val embeddedBackupHour: Int = rootConfig.getInt("storage.embedded.backup-hour")
}<commit_msg>Making embedded storage the default<commit_after>package com.softwaremill.codebrag.dao

import com.typesafe.config.Config
import scala.Predef._
import com.typesafe.scalalogging.slf4j.Logging

trait DaoConfig extends Logging {
  def rootConfig: Config

  object StorageType extends Enumeration {
    type StorageType = Value
    val Embedded, Mongo = Value
  }
  import StorageType._

  lazy val storageType: StorageType = {
    if (rootConfig.hasPath("storage.type")) {
      rootConfig.getString("storage.type").toLowerCase.trim match {
        case "embedded" => Embedded
        case "mongo" => Mongo
        case x => throw new IllegalStateException(s"Unknown storage type $x")
      }
    } else {
      logger.info("Assuming default storage: embedded")
      Embedded
    }
  }

  lazy val isEmbeddedStorage = storageType == StorageType.Embedded

  lazy val mongoServers: String = rootConfig.getString("mongo.servers")
  lazy val mongoDatabase: String = rootConfig.getString("mongo.database")

  lazy val embeddedDataDir: String = rootConfig.getString("storage.embedded.datadir")
  lazy val embeddedBackupHour: Int = rootConfig.getInt("storage.embedded.backup-hour")
}
{'fraction_non_alphanumeric': 0.09482758620689655, 'fraction_numerical': 0.0008620689655172414, 'mean_word_length': 3.9278131634819533, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6274101', 'n_tokens_mistral': 694, 'n_tokens_neox': 682, 'n_words': 166}