<commit_before>package com.cognifide.gradle.aem.instance.tail

import com.cognifide.gradle.aem.common.instance.names
import com.cognifide.gradle.aem.common.tasks.InstanceTask
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction

@UseExperimental(ExperimentalCoroutinesApi::class)
open class InstanceTail : InstanceTask() {

    @Internal
    val tailer = InstanceTailer(aem)

    fun tailer(options: InstanceTailer.() -> Unit) {
        tailer.apply(options)
    }

    init {
        description = "Tails logs from all configured instances (local & remote) and notifies about unknown errors."
    }

    @TaskAction
    fun tail() {
        tailer.apply {
            instances.convention(this@InstanceTail.instances)

            aem.logger.lifecycle("Tailing logs from instances: ${instances.get().names}")
            aem.logger.lifecycle("Filter incidents using file: ${tailer.incidentFilter}")
            tail()
        }
    }

    override fun projectEvaluated() {
        super.projectEvaluated()
        tailer.logFilter.excludeFile(tailer.incidentFilter.get().asFile)
    }

    companion object {
        const val NAME = "instanceTail"
    }
}<commit_msg>Minor bug fixes<commit_after>package com.cognifide.gradle.aem.instance.tail

import com.cognifide.gradle.aem.common.instance.names
import com.cognifide.gradle.aem.common.tasks.InstanceTask
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction

@UseExperimental(ExperimentalCoroutinesApi::class)
open class InstanceTail : InstanceTask() {

    @Internal
    val tailer = InstanceTailer(aem)

    fun tailer(options: InstanceTailer.() -> Unit) {
        tailer.apply(options)
    }

    @TaskAction
    fun tail() {
        tailer.apply {
            instances.convention(this@InstanceTail.instances)

            logger.lifecycle("Tailing logs from instances: ${instances.get().names}")
            logger.lifecycle("Filter incidents using file: ${tailer.incidentFilter.get()}")

            tail()
        }
    }

    override fun projectEvaluated() {
        super.projectEvaluated()
        tailer.logFilter.excludeFile(tailer.incidentFilter.get().asFile)
    }

    init {
        description = "Tails logs from all configured instances (local & remote) and notifies about unknown errors."
    }

    companion object {
        const val NAME = "instanceTail"
    }
}
{'fraction_non_alphanumeric': 0.10245078344716754, 'fraction_numerical': 0.0, 'mean_word_length': 3.1430948419301163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2371552', 'n_tokens_mistral': 761, 'n_tokens_neox': 739, 'n_words': 138}