<commit_before>package asset.pipeline.groovytemplate

import asset.pipeline.AbstractProcessor
import asset.pipeline.AssetCompiler
import asset.pipeline.AssetFile
import grails.util.Holders
import groovy.text.SimpleTemplateEngine
import groovy.util.logging.Log4j

@Log4j
class GroovyTemplateProcessor extends AbstractProcessor {
    def config
    def engine

    def binding

    GroovyTemplateProcessor(AssetCompiler compiler) {
        super(compiler)
        def grailsApplication = Holders.grailsApplication

        this.engine = new SimpleTemplateEngine(this.class.classLoader)

        this.binding = [
                grailsApplication: grailsApplication,
                config: grailsApplication.config
        ]
    }

    String process(String inputText, AssetFile assetFile) {
        log.debug("Processing assetFile: ${assetFile.file.name}")
        StringWriter stringWriter = new StringWriter()
        try {
            engine.createTemplate(inputText).make(binding).writeTo(stringWriter)
            return stringWriter.toString()
        } catch (Exception e) {
            log.error("Error compiling groovy template asset file", e)
            throw e
        } finally {
            stringWriter.close()
        }
    }
}<commit_msg>correct issue when using log in debug, use assetFile.name instead of assetFile.file.name<commit_after>package asset.pipeline.groovytemplate

import asset.pipeline.AbstractProcessor
import asset.pipeline.AssetCompiler
import asset.pipeline.AssetFile
import grails.util.Holders
import groovy.text.SimpleTemplateEngine
import groovy.util.logging.Log4j

@Log4j
class GroovyTemplateProcessor extends AbstractProcessor {
    def config
    def engine

    def binding

    GroovyTemplateProcessor(AssetCompiler compiler) {
        super(compiler)
        def grailsApplication = Holders.grailsApplication

        this.engine = new SimpleTemplateEngine(this.class.classLoader)

        this.binding = [
                grailsApplication: grailsApplication,
                config: grailsApplication.config
        ]
    }

    String process(String inputText, AssetFile assetFile) {
        log.debug("Processing assetFile: ${assetFile.name}")
        StringWriter stringWriter = new StringWriter()
        try {
            engine.createTemplate(inputText).make(binding).writeTo(stringWriter)
            return stringWriter.toString()
        } catch (Exception e) {
            log.error("Error compiling groovy template asset file", e)
            throw e
        } finally {
            stringWriter.close()
        }
    }
}
{'fraction_non_alphanumeric': 0.0717610550814585, 'fraction_numerical': 0.0015515903801396431, 'mean_word_length': 2.81508875739645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2771003', 'n_tokens_mistral': 663, 'n_tokens_neox': 643, 'n_words': 149}