<commit_before>package lert.core.rule

import java.io.{BufferedReader, InputStream, InputStreamReader}

import com.typesafe.scalalogging.LazyLogging
import lert.core.rule.target.TargetHelper
import groovy.lang.{Binding, GroovyShell}
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.customizers.ImportCustomizer

trait RuleRunner {
  def process(script: InputStream)
}

class GroovyRuleRunner extends RuleRunner with LazyLogging {
  override def process(script: InputStream): Unit = {
    try {
      val bindings = new Binding() {
        //setVariable("message", JavaUtils.toJava(mes.data))
      }
      val importCustomizer = new ImportCustomizer()
      importCustomizer.addStaticStars(classOf[TargetHelper].getName)

      val config = new CompilerConfiguration() {
        addCompilationCustomizers(importCustomizer)
      }

      val shell = new GroovyShell(this.getClass.getClassLoader, bindings, config)
      shell.evaluate(new BufferedReader(new InputStreamReader(script)))
    } catch {
      case ex: Exception =>
        logger.error(ex.getLocalizedMessage)
        logger.debug(ex.getLocalizedMessage, ex)
    }
  }
}<commit_msg>Revert exception logging<commit_after>package lert.core.rule

import java.io.{BufferedReader, InputStream, InputStreamReader}

import com.typesafe.scalalogging.LazyLogging
import lert.core.rule.target.TargetHelper
import groovy.lang.{Binding, GroovyShell}
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.customizers.ImportCustomizer

trait RuleRunner {
  def process(script: InputStream)
}

class GroovyRuleRunner extends RuleRunner with LazyLogging {
  override def process(script: InputStream): Unit = {
    val bindings = new Binding() {
      //setVariable("message", JavaUtils.toJava(mes.data))
    }
    val importCustomizer = new ImportCustomizer()
    importCustomizer.addStaticStars(classOf[TargetHelper].getName)

    val config = new CompilerConfiguration() {
      addCompilationCustomizers(importCustomizer)
    }

    val shell = new GroovyShell(this.getClass.getClassLoader, bindings, config)
    shell.evaluate(new BufferedReader(new InputStreamReader(script)))
  }
}
{'fraction_non_alphanumeric': 0.09029345372460497, 'fraction_numerical': 0.0, 'mean_word_length': 4.653061224489796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7316629', 'n_tokens_mistral': 656, 'n_tokens_neox': 634, 'n_words': 126}