open fun getLogFileFormat()

in src/main/kotlin/com/intellij/ideolog/util/IdeologDocumentContext.kt [114:122]


  open fun getLogFileFormat(fileLines: Sequence<String>, regexMatchers: List<RegexLogParser>): LogFileFormat {
    val startTime = System.nanoTime()
    val sumByMatcher = regexMatchers.map {
      it to fileLines.count { line ->
        System.nanoTime() - startTime < INTERRUPT_AFTER_NS && it.regex.matcher(line).find()
      }
    }
    return LogFileFormat(sumByMatcher.filter { it.second >= MIN_FORMAT_MATCHES }.maxByOrNull { it.second }?.first)
  }